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

data-factory

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-factory

Manage data and stack easily with data-factory.

  • 0.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Data Factory Javascript

Manage data and stack easily with data-factory

Install

npm install --save data-factory

Usage

Create as much data that you need and manage them in one instance.

const dataFactory = require('data-factory');

var data = new dataFactory;

data.set('Wait why ? I have not key ?') // set data to local data

data.push('coucou'); // set data to local stack
data.push('my');
data.push('Bread');

data.set('toto', 'tutu'); // set 'toto' key and 'tutu' value
data.set('tutu', ['toto']);
data.tutu.push('test'); // get tutu instance created before and push to local stack in tutu instance

data.set('parent', 'I am THE parent');
data.parent.set('child', 'Am I the child ?');
data.parent.concat(['pop me', 'and me too']);
data.parent.pop(1); // remove element from stack
data.parent.pop();

data.set('removeMe', 'data')
data.unset('removeMe'); // remove instance + data 

console.log(data.get()); // get local data

console.log(data.get('tutu')); // get tutu data (data.tutu to get tutu instance)
console.log(data.tutu.getStack());

console.log(data.get('parent'));
console.log(data.parent.get('child'));
console.log(data.parent.getStack());

console.log(data.get('removeMe'));

console.log(data.getStack()); // get stack list
console.log(data.getAll()); // get all data from instance

Functions

NameDescriptionAdditionnal
set(key: string, data: any) : currentAdd data in key from current instance and create key instance
unset(key: string) : currentRemove data in key from current instance and remove key instance
push(data: any) : currentPush data in stack from current instance
concat(data: any) : currentConcat data with local stack from current instance
pop(key: number) : currentRemove element from stack
get(key: string) : currentGet specific data from current instance
getStack() : currentGet all local stack from current instance
getAll() : currentGet all local data from current instance

Keywords

FAQs

Package last updated on 19 Dec 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