A script that cleans up a package name for use in other scripts.
This script will attempt to read the package name from the environment via
npm_package_name or by reading the local package.json.
It will then either trim problem characters from the name:
npx @robmarr/clean-package-name // returns scope/clean-package-name // (anything but letters, numbers, underscores, dashes and forward slashes are removed)
The npm scope of a package can be removed via the
npx @robmarr/clean-package-name --no-scope // returns clean-package-name // (again removes problem characters but then returns everything after the first forward slash)
Unless stated otherwise all works are:
- Copyright © Robin Marr
and licensed under: