JSPM

gfynonce

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q45869F
  • License MIT

nonce generator in the 'adjective adjective animal' pattern that that Gfycat (and Twitch) uses

Package Exports

  • gfynonce
  • gfynonce/dist/gfynonce.es.js
  • gfynonce/dist/gfynonce.js
  • gfynonce/dist/gfynonce.min.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gfynonce) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gfynonce - license npm npm bundle size (minified + gzip) Travis node

gfynonce is a "small" library that generates unique word compositions in the "adjective, adjective, animal" format that both Gfycat and Twitch uses. It tries it's best to generate nonces without repeating the same adjective and allows some customization, such as providing the number of adjectives desired or the separator character.

Installation and Usage

For your convenience, it is available in 3 forms, so choose whatever will work best for you:

Command Line

Installing gfynonce for the command line is as simple as running the following command:

npm i -g gfynonce

Then, simply run gfynonce and it will generate a nonce with the default settings.

$ gfynonce
FatSmallAmericanBulldog

Additionally, you can provide some arguments to customize it, such as --adjectives <number> and --separator <char>.

$ gfynonce --adjectives 5 --separator .
Big.Small.Fancy.Elegant.Shy.Dipper

Node

The installation procedure is almost the same, simply add it to your current project:

npm i --save gfynonce

And you should be good to import it!

const gfynonce = require('gfynonce');

console.log(gfynonce({ adjectives: 1, separator: '_' }));
// Tiny_Hog

Browser

Unpkg kindly provides a fast CDN for NPM packages which you can use to access the UMD script.

<script src="https://unpkg.com/gfynonce@latest/dist/gfynonce.min.js"></script>
<script>
  console.log(gfynonce());
  // HugeSmallArthropods
</script>