pabrik
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

PABRIK 🏭 🏭 🏭

Pabrik is a helper that will help you creating dummy object. My first tought when creating this package, is to use this on creating dummy object when writing test.

Add package to your project

npm install pabrik --save-dev

How to use

const { Pabrik } = require('pabrik')
 
const products = {
  asset: {
    id: "asset-id-01",
    name: "Honda HRV",
    condition: "good",
    price: 300000000
  },
  employee: {
    id: "employee-id-01",
    firstName: "John",
    lastName: "Doe",
    age: 25
  }
}
 
const pabrik = new Pabrik(products)
 
const newAsset = pabrik.create('asset')
console.log(newAsset)
/*
  RESULT
  {
    id: 'asset-id-01',
    name: 'Honda HRV',
    condition: 'good',
    price: 300000000
  }
*/
 
const newEmployee = pabrik.create('employee', { id: "new-employee-id", lastName: 'Lee', age: 30 })
console.log(newEmployee)
/*
  RESULT
  {
    id: "new-employee-id",
    firstName: 'John',
    lastName: 'Lee',
    age: 30
  }
*/
 

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i pabrik

      Weekly Downloads

      0

      Version

      1.0.2

      License

      MIT

      Unpacked Size

      6.32 kB

      Total Files

      8

      Last publish

      Collaborators

      • hendrixsilaen