Comparing version 3.0.2 to 3.1.0
# Change Log | ||
This project adheres to [Semantic Versioning](http://semver.org/). | ||
## 3.1 | ||
* Add `npx nanoid` CLI. | ||
## 3.0.2 | ||
@@ -5,0 +8,0 @@ * Fix docs (by Dylan Irlbeck ). |
{ | ||
"name": "nanoid", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "A tiny (108 bytes), secure URL-friendly unique string ID generator", | ||
@@ -17,2 +17,3 @@ "keywords": [ | ||
}, | ||
"bin": "./bin/index.js", | ||
"sideEffects": false, | ||
@@ -36,2 +37,7 @@ "type": "module", | ||
}, | ||
"./bin/package.json": "./bin/package.json", | ||
"./bin": { | ||
"require": "./bin/index.cjs", | ||
"import": "./bin/index.js" | ||
}, | ||
"./non-secure/package.json": "./non-secure/package.json", | ||
@@ -38,0 +44,0 @@ "./non-secure": { |
@@ -13,5 +13,5 @@ # Nano ID | ||
[Size Limit] controls the size. | ||
* **Fast.** It is 40% faster than UUID. | ||
* **Safe.** It uses cryptographically strong random APIs. | ||
Can be used in clusters. | ||
* **Fast.** It is 16% faster than UUID. | ||
* **Compact.** It uses a larger alphabet than UUID (`A-Za-z0-9_-`). | ||
@@ -47,2 +47,3 @@ So ID size was reduced from 36 to 21 symbols. | ||
* [React](#react) | ||
* [Create React App](#create-react-app) | ||
* [React Native](#react-native) | ||
@@ -53,2 +54,3 @@ * [PouchDB and CouchDB](#pouchdb-and-couchdb) | ||
* [Web Workers](#web-workers) | ||
* [CLI](#cli) | ||
* [Other Programming Languages](#other-programming-languages) | ||
@@ -111,3 +113,2 @@ * [API](#api) | ||
* [`nanoid-dictionary`] with popular alphabets to use with `customAlphabet`. | ||
* [`nanoid-cli`] to generate IDs from CLI. | ||
* [`nanoid-good`] to be sure that your ID doesn't contain any obscene words. | ||
@@ -117,3 +118,2 @@ | ||
[ID size calculator]: https://zelark.github.io/nano-id-cc/ | ||
[`nanoid-cli`]: https://github.com/twhitbeck/nanoid-cli | ||
[`nanoid-good`]: https://github.com/y-gagar1n/nanoid-good | ||
@@ -127,3 +127,2 @@ | ||
* **Unpredictability.** Instead of using the unsafe `Math.random()`, Nano ID | ||
@@ -205,2 +204,19 @@ uses the `crypto` module in Node.js and the Web Crypto API in browsers. | ||
### Create React App | ||
Create React App has [a problem](https://github.com/ai/nanoid/issues/205) | ||
with ES modules packages. | ||
``` | ||
TypeError: (0 , _nanoid.nanoid) is not a function | ||
``` | ||
If you have an error above, here is temporary fix: | ||
1. Use Nano ID 2 instead of 3: `npm i nanoid@^2.0.0`. | ||
2. Vote for | ||
[pull request](https://github.com/facebook/create-react-app/pull/8768), | ||
that fix dual packages support. | ||
### React Native | ||
@@ -286,2 +302,18 @@ | ||
### CLI | ||
You can get unique ID in terminal by calling `npx nanoid`. You need only | ||
Node.js in the system. You do not need Nano ID to be installed anywhere. | ||
```sh | ||
$ npx nanoid | ||
npx: installed 1 in 0.63s | ||
LZfXLFzPPR4NNrgjlWDxn | ||
``` | ||
If you want to change alphabet or ID size, you should use [`nanoid-cli`]. | ||
[`nanoid-cli`]: https://github.com/twhitbeck/nanoid-cli | ||
### Other Programming Languages | ||
@@ -308,5 +340,5 @@ | ||
Also, [CLI tool] is available to generate IDs from a command line. | ||
Also, [CLI] is available to generate IDs from a command line. | ||
[CLI tool]: https://github.com/twhitbeck/nanoid-cli | ||
[CLI]: #cli | ||
@@ -313,0 +345,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43958
21
629
443