This repository has been archived by the owner on Jun 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from a-type/gfycat
Gfycat animals, more options
- Loading branch information
Showing
8 changed files
with
10,822 additions
and
644 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,33 @@ | ||
# adjective-adjective-animal | ||
Suitably random and reasonably unique (and fairly adorable) human readable ids | ||
### Suitably random and reasonably unique (and fairly adorable) human readable ids | ||
|
||
> Fun fact: most if not all of the adjectives are Scribblenauts-compatible. Use that information at your own discretion. | ||
# Usage | ||
> Now with GfyCat lists! | ||
## Usage | ||
The library export is a function. Call the function with the number of adjectives you want before the animal. Default is 2. | ||
|
||
The function returns a `Promise` for the adjective-animal string. This is mainly because generating cyrptographically strong random data is not guaranteed to be very quick. | ||
The function returns a Promise for the adjective-animal string. This is mainly because generating cyrptographically strong random data is not guaranteed to be very quick. | ||
|
||
``` javascript | ||
var generate = require("adjective-adjective-animal"); | ||
|
||
generate().then(console.log); | ||
// "supercurious-senior-woodlouse" | ||
|
||
var generate = require("adjective-adjective-animal"); | ||
generate(5).then(console.log); | ||
// "unquiet-calm-omniscient-ornate-industrious-deer" | ||
|
||
generate().then(console.log); | ||
// "supercurious-senior-woodlouse" | ||
// valid formats : upper (spaces), lower (spaces), sentence (spaces), title (spaces), | ||
// camel, pascal, snake, param, dot, path, constant, swap, ucFirst, lcFirst | ||
generate("pascal").then(console.log); | ||
// "OddPortentBullfrog" | ||
|
||
generate(5).then(console.log); | ||
// "unquiet-calm-omniscient-ornate-industrious-deer" | ||
generate({ adjectives : 3, format : "dot"}).then(console.log); | ||
// "undead.energetic.mortified.albatross" | ||
``` | ||
|
||
``` | ||
# About | ||
## About | ||
There's nothing too special about this package—there are many like it—but I made this one because I thought it would be fun and I wanted mine to be cryptographically strong. Although the space is probably too small to guarantee any sort of uniqueness reliably, at least the randomness is not predictable. It uses node's core crypto library to choose each word. | ||
|
||
There's nothing too special about this package—there are many like it—but I made this one because I thought it would be fun and I wanted mine to be cryptographically strong. Although the space is probably too small to guarantee any sort of uniqueness reliably, at least the randomness is not predictable. It uses node's core `crypto` library to choose each word. | ||
## Thanks | ||
Thanks to [@ChrissiQ](https://github.com/ChrissiQ) for pointing me in the right direction to use GfyCat lists instead of my own. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.