CDN friendly build of shortid
npm install shortid-dist
CDN friendly build of [shortid][shortid].
The shortid function is exposed as a global.
3 KB
31 KB
alert(shortid());
See the [Live Demo][demo].
Follow these instructions to get a local copy of the project source code for development.
The index.html file in the project root can be opened directly in a browser (file:// URL).
The CWD of the npm commands is assumed to be the project root folder.
git clone https://github.com/adamjarret/shortid-dist.git
cd shortid-dist
npm install
Bundle shortid with webpack (minified and unminified):
npm run build
Delete all generated files:
npm run clean
* [shortid][shortid]
* [webpack][webpack]
Fork the repo and submit a pull request.
[SemVer][semVer] is used for versioning.
For the versions available, see the [tags on this repository][tags].
1. Examine what will be included in the npm bundle:
npm run pack
The npm run pack command requires npm version 6.4.1 or later (because it uses the --dry-run flag).
For older versions of npm, run tar -tvf "$(npm pack)" to list the contents of the generated tarball.
2. Update the links in the README.md and index.html files (and commit the changes) _before_ running npm version:
npm run links -- patch
git add README.md index.html
git commit -m "Updated links"
3. Bump the version number in __package.json__ and create a git tag:
npm version patch
The npm version and npm run links command each accepts a [SemVer][semVer] argument:
(where is a standard version number, ex. 1.0.0).
4. Publish a new version:
npm publish
git push origin master --tags
This project is licensed under the _BSD Zero Clause License_.
See the [LICENSE.txt][license] file for details.
shortid is licensed under the _MIT +no-false-attribs License_.
See the [LICENSE.shortid.txt][shortidLicense] file for details.
[license]: https://github.com/adamjarret/shortid-dist/blob/master/LICENSE.txt
[shortidLicense]: https://github.com/adamjarret/shortid-dist/blob/master/dist/LICENSE.shortid.txt
[shortid]: https://www.npmjs.com/package/shortid
[semVer]: https://semver.org/
[tags]: https://github.com/adamjarret/shortid-dist/tags
[demo]: https://adamjarret.github.io/shortid-dist
[webpack]: http://webpack.js.org