string-content-spinner
Node.js recursive content spinner algorithm.
API
spin
function
Spin a string.
Parameters:
;
Example:
const spin = ; const result = ; console;
This will log either Hello world
or Good morning
.
factory
function
Generates a new spin
function with custom section markers and delimiter.
Parameters:
;
Example:
// Get factory functionconst spinFactory = factory; // Generate new spin function with custom section markers and delimiterconst spin = ; // Use it!const result = ; console;
This will log either Hello world
or Hello mars
.
Development
Clone repository, then run npm install
.
NPM commands
npm run prettier
: run prettier on source files (both lib and test files)npm run lint
: lint source files (both lib and test files, usingeslint
)npm test
ornpm run test
: run unit testsnpm run git-add
: run prettor, lint and unit tests, if all passed, stage changes