Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
lodash.snakecase
Advanced tools
The lodash.snakecase npm package is a utility function that converts a given string to snake_case, where each word is lowercased and separated by an underscore character. It is part of the Lodash library, which is a popular JavaScript utility library for working with arrays, numbers, objects, strings, etc.
String Conversion to snake_case
Converts a string with spaces, camelCase, or PascalCase to snake_case.
_.snakeCase('Foo Bar'); // => 'foo_bar'
Handling Special Characters
Converts a string with dashes or other non-alphanumeric characters to snake_case, removing the special characters.
_.snakeCase('foo-bar'); // => 'foo_bar'
Accommodating Mixed Cases and Numbers
Handles strings with a mix of cases and numbers, ensuring numbers are preserved in the conversion.
_.snakeCase('fooBar2023'); // => 'foo_bar2023'
This package provides similar functionality to lodash.snakecase by converting a string to snake_case. It is a smaller, more focused package if you only need snake case conversion without the additional utility functions provided by Lodash.
change-case is a more comprehensive string transformation library that includes snake case conversion among many other case transformations. It offers a broader set of string manipulation utilities compared to lodash.snakecase.
The 'case' package is another alternative that supports various case transformations, including snake case. It is similar to change-case and can be used if you need a variety of string case conversions.
The lodash method _.snakeCase
exported as a Node.js module.
Using npm:
$ {sudo -H} npm i -g npm
$ npm i --save lodash.snakecase
In Node.js:
var snakeCase = require('lodash.snakecase');
See the documentation or package source for more details.
FAQs
The lodash method `_.snakeCase` exported as a module.
We found that lodash.snakecase demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.