1.1.0 • Published 3 years ago

stoc v1.1.0

Weekly downloads
70
License
MIT
Repository
github
Last release
3 years ago

Stoc

Build Status npm version npm GitHub license

String to object compiler for Javascript

Installation

npm install stoc

# or

yarn install stoc

Usage

const stoc = require('stoc');

stoc(`
  {
    name
    gender
    children {
      name: nickname
      age
      hobbies: habits {
        name
        type
      }
    }
  }
`)

// or
stoc('{name gender children{name:nickname age hobbies:habits{name type}}}')

// Output =>

{
  name: 1,
  gender: 1,
  children: {
    name: 'nickname',
    age: 1,
    hobbies: 'habits',
    habits: {
      name: 1,
      type: 1
    }
  }
}

Enjoy !

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

6 years ago

1.0.0

6 years ago