
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Feel free to for a feature request, I'll try my best to help :)
npm install textamer
// or yarn
yarn add textamer
const { search } = require('textamer');
search.adjacentDuplications(text, options)
Returns an array contains groups of adjecent duplications found, or return null if no duplication
options properties:
- ignoreCase:boolean - If true, the search will include words that have different case. Default: false
search.adjacentDuplications('the the cat Cat catherine');
// ['the the']
search.adjacentDuplications('the the cat Cat Catherine', {
ignoreCase: true,
});
// ['the the', 'cat Cat']
const { process } = require('textamer');
process.capitalizeWords(text, word)
Returns a new string with all the words that match 2nd argument - first letter capitalized. Partially matches are ignore.
process.capitalizeWords('frank talks about it frankly', 'frank');
// 'Frank talks about it frankly' ('frank' in 'frankly' is a partial match, hence ignored)
process.capitalizeAllFirstLetters(text, options)
Returns text with all first letter capitalized
options properties:
- keepUppercase:boolean - If true, the current uppercase letters will not change. Default: false
process.capitalizeAllFirstLetters('foo bAr');
// Foo Bar
process.capitalizeAllFirstLetters('foo bAr', { keepUppercase: true });
// Foo BAr
const { match } = require('textamer');
match.ipv4(str)
Returns true if str is a valid IPv4, leading & trailing whitespaces are ignored
match.ipv4(' 192.168.2.1 ');
// true
match.ipv4(' 192.168.300.1 ');
// false
FAQs
A collection of utils to work with text
We found that textamer 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.