Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

object-key-prefixer

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-key-prefixer

Prefix all keys in an object and return a new object with updated keys

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

object-key-prefixer

PRs Welcome license

A JavaScript object key prefixer

A simple method that takes an object and returns a new object where all of the top-level keys have been prefixed by some string.

Table of Contents

Install

npm install --save object-key-prefixer

Usage

var prefixer = require('object-key-prefixer');
var obj = {
  one: 'foo',
  two: {
    bar: 'baz'
  }
}

prefixer(obj, 'awesome_')

Output:

{
  awesome_one: 'foo',
  awesome_two: {
    bar: 'baz'
  }
}

Contribute

PRs accepted. Note that code uses standard styling.

License

MIT © Dan Caddigan

Keywords

FAQs

Package last updated on 07 Mar 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc