https://github.com/npm/npm-normalize-package-bin
Turn any flavor of allowable package.json bin into a normalized object
https://github.com/npm/npm-normalize-package-bin
npm-cli
Last synced: about 1 year ago
JSON representation
Turn any flavor of allowable package.json bin into a normalized object
- Host: GitHub
- URL: https://github.com/npm/npm-normalize-package-bin
- Owner: npm
- License: isc
- Created: 2019-12-09T20:22:36.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-09T16:23:15.000Z (about 1 year ago)
- Last Synced: 2025-04-19T13:16:07.509Z (about 1 year ago)
- Topics: npm-cli
- Language: JavaScript
- Homepage:
- Size: 124 KB
- Stars: 7
- Watchers: 8
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# npm-normalize-package-bin
Turn any flavor of allowable package.json bin into a normalized object.
## API
```js
const normalize = require('npm-normalize-package-bin')
const pkg = {name: 'foo', bin: 'bar'}
console.log(normalize(pkg)) // {name:'foo', bin:{foo: 'bar'}}
```
Also strips out weird dots and slashes to prevent accidental and/or
malicious bad behavior when the package is installed.