@pelevesque/supersubstr
v1.0.3
Published
Like Javascript's substr, but with wrapping and reversed substrings.
Downloads
15
Readme
supersubstr
Like Javascript's substr, but with wrapping and reversed substrings.
Node Repository
https://www.npmjs.com/package/@pelevesque/supersubstr
Installation
npm install @pelevesque/supersubstr
Tests
Command | Description
---------------------------- | ------------
npm test
or npm run test
| All Tests Below
npm run cover
| Standard Style
npm run standard
| Coverage
npm run unit
| Unit Tests
Usage
Parameters
str (required)
options (optional) default = { startIndex = 0, length, reverse = false }
Examples
const supersubstr = require('@pelevesque/supersubstr')
const str = '12345'
const result = supersubstr(str, { startIndex: 1 })
// result === '2345'
const str = '12345'
const result = supersubstr(str, { startIndex: 2, length: 10, reverse: true })
// result === '3215432154'