
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
string-features
Advanced tools
String-features or simptly str as the name suggests is having all the features that you will normally require while working with strings.
The cleaner and readable the code the better, with this motive i've created this package which is open for changes.
If you want to make any cahnges just make the changes and update README. I'll update everything and add the name to contributers list.
If you want to use this library, you first need to install the Node.js.
When you install node.js, will also be installed npm.
Please run the following command.
npm install --save string-features
var str = require('string-features');
Following are few examples, by all means this is not an exaustive list and you can do much more with many methods available for your use.
str.dashCase("fooBar") // foo-bar
str.underscoreCase("BatteryAAA") // battery_aaa
str.underscoreCase("coldWind") //cold_wind
str.removeHTMLTags("<html> <body> Javascript<body> is not Java") // Javascript is not Java
str.removeSpecialCharacters("coding$%-is%& fun", true) // codingisfun
str.reverse("Hello world") // dlrow olleH
str.isEmpty(" ") //true
str.isUpperCase("Hello") //false
str.isUpperCase("HELLO") //true
str.removeExtraSpaces(" wrong spacing here ")) // wrong spacing here
str.count('abcabc', 'abc') // 2
Converts string to title case.
First letter of every word is capital rest all are lower case
str.titleCase("title case") // Title Case
str.titleCase("TItle cAse") // Title Case
Converts string to camel case
str.toCamelCase("coding-is-fun") // codingIsFun
str.toCamelCase("coding is fun") // codingIsFun
str.toCamelCase("coding$% is%& fun") // codingIsFun
Removes special characters from string.
You can also choose to remove spaces from the string by passsing second param as true default is false.
str.removeSpecialCharacters("coding$%-is%& fun", true) // codingisfun
str.removeSpecialCharacters("coding$%-is%& fun", false) // codingis fun
str.reverse("Coding") // gnidoC
str.isEmpty(" ") //true
str.isEmpty(null) //true
isUpperCase
Return true if the string is made up of all capital letters.
isLowerCase
Return true if the string is made up of all lower letters.
isNumeric
Return true if the string is made up of all numbers.
isNaN(123) // false
isNaN('123') // false
isNaN('1e10000') // false (This translates to Infinity, which is a number)
isNaN('foo') // true
isNaN('10px') // true
str.removeExtraSpaces(" this contains spaces ")) // this contains spaces
str.contains("coding is fun", fun) // true
str.count('abcabc', 'abc') // 2
str.count("this is ice", "is") // 2
str.dashCase("fooBar") // foo-bar
str.dashCase("FooBar") // -foo-bar
str.removeHTMLTags("<html> <body> Javascript<body> is not Java") // Javascript is not Java
str.underscoreCase(BatteryAAA) // battery_aaa
str.underscoreCase(coldWind) // cold_wind
str.endsWith("Hello World", "World") // True
str.endsWith("Hello#", "#") // True
str.endsWith("This is a test", "test") // True
str.endsWith("This is a test", "st") // True
FAQs
Common things you need while working with strings
The npm package string-features receives a total of 6 weekly downloads. As such, string-features popularity was classified as not popular.
We found that string-features 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.