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

@remypar5/array-to-db

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@remypar5/array-to-db

A simple utility to create a database table out of a given array of objects

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

arrayToDb()

A simple utility to create a DB table out of a given array of objects. Use it to create a simple object out of an array of objects, accessible by each object's respective unique identifier. This provides easier and faster access.

Installation

NPM

npm i --save @remypar5/array-to-db

Yarn

yarn add @remypar5/array-to-db

Usage:

import arrayToDb from '@remypar5/array-to-db';

const heroesArray = [
    { id: 'luke', name: 'Luke Skywalker' },
    { id: 'tony', name: 'Iron Man' },
    { id: 'bruce', name: 'Batman' },
];
const heroes = arrayToDb(heroesArray);
console.log(heroes);
/* {
    luke: { id: 'luke', name: 'Luke Skywalker' },
    tony: { id: 'tony', name: 'Iron Man' },
    bruce: { id: 'bruce', name: 'Batman' },
}; */

FAQs

Package last updated on 08 Apr 2019

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