Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Voca is a JavaScript library for manipulating strings. https://vocajs.com
v.camelCase('bird flight'); // => 'birdFlight'
v.sprintf('%s costs $%.2f', 'Tea', 1.5); // => 'Tea costs $1.50'
v.slugify('What a wonderful world'); // => 'what-a-wonderful-world'
The Voca library offers helpful functions to make string manipulations comfortable: change case, trim, pad, slugifly, latinise, sprintf'y, truncate, escape and much more. The modular design allows to load the entire library, or individual functions to minimize the application builds. The library is fully tested, well documented and long-term supported.
See the complete documentation at https://vocajs.com
Voca can be used in various environments.
Install the library with npm into your local modules directory:
npm install voca
Then in your application import the entire library:
var v = require('voca');
v.trim(' Hello World! '); // => 'Hello World'
v.sprintf('%d red %s', 3, 'apples'); // => '3 red apples'
Or individual functions:
var words = require('voca/words');
var slugify = require('voca/slugify');
words('welcome to Earth'); // => ['welcome', 'to', 'Earth']
slugify('café latté'); // => 'caffe-latte'
Load the UMD builds directly into browser's web page:
dist/voca.min.js
minified production-ready, with source mapdist/voca.js
uncompressed with comments<script src="voca.js" type="text/javascript"></script>
Then a global variable v
is exposed for the entire library:
<script type="text/javascript">
v.last('wonderful world', 4); // => 'world'
</script>
For bug reports, documentation typos or feature requests feel free to create an issue.
Please make sure that the same problem wasn't reported already.
For general usage questions please ask on StackOverflow.
Contribution is welcome!
See more details in Contributing guide.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Dmitri Pavlutin
@panzerdp
dmitri@rainsoft.io
Licensed under MIT
FAQs
The ultimate JavaScript string library
The npm package voca receives a total of 73,170 weekly downloads. As such, voca popularity was classified as popular.
We found that voca 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 for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.