
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
decamelize-keys
Advanced tools
Convert object keys from camel case using
decamelize
npm install decamelize-keys
import decamelizeKeys from 'decamelize-keys';
// Convert an object
decamelizeKeys({fooBar: true});
//=> {foo_bar: true}
// Convert an array of objects
decamelizeKeys([{fooBar: true}, {barFoo: false}]);
//=> [{foo_bar: true}, {bar_foo: false}]
Type: object | object[]
An object or array of objects to decamelize.
Type: object
Type: string
Default: '_'
The character or string used to separate words.
import decamelizeKeys from 'decamelize-keys';
decamelizeKeys({fooBar: true});
//=> {foo_bar: true}
decamelizeKeys({fooBar: true}, {separator: '-'});
//=> {'foo-bar': true}
Type: Array<string | RegExp>
Default: []
Exclude keys from being decamelized.
Type: boolean
Default: false
Recurse nested objects and objects in arrays.
import decamelizeKeys from 'decamelize-keys';
decamelizeKeys({fooBar: true, nested: {unicornRainbow: true}}, {deep: true});
//=> {foo_bar: true, nested: {unicorn_rainbow: true}}
Similar to `decamelize-keys`, `humps` can also convert keys between camelCase and snake_case. However, `humps` provides more comprehensive options for both decamelizing and camelizing keys, making it a versatile choice for different case conversion needs.
The `snakeize` package is focused on converting object keys to snake_case. While it serves a similar purpose to `decamelize-keys` in terms of changing the case of keys, it is specifically tailored for snake_case conversion without the flexibility of choosing a custom separator.
As the inverse of `decamelize-keys`, `camelcase-keys` converts object keys from snake_case or kebab-case to camelCase. It's useful for scenarios where you need to convert data to match JavaScript's naming conventions, offering a complementary functionality.
FAQs
Convert object keys from camel case
The npm package decamelize-keys receives a total of 7,985,144 weekly downloads. As such, decamelize-keys popularity was classified as popular.
We found that decamelize-keys 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
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.