pre-suf
Advanced tools
Weekly downloads
Readme
Manipulate strings with prefixes and suffixes.
$ npm install pre-suf --save
const presuf = require('pre-suf')
presuf.ensureLeading('path/to', '/') // '/path/to'
presuf.removeEnding('/path/to//', '/') // '/path/to'
Ensures that the new string will have prefix
at the beginning of str
.
If str
does not begin with prefix
, prefix
will be added to the beggining of str
.
Removes the leading prefix
of str
.
presuf.removeLeading('/abc', '/a') // 'bc'
presuf.removeLeading('/a/abc', '/a') // 'bc'. removes 2 groups of '/a'
MIT
FAQs
Manipulate strings with prefixes and suffixes.
The npm package pre-suf receives a total of 629 weekly downloads. As such, pre-suf popularity was classified as not popular.
We found that pre-suf demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.