4.1.1 • Published 5 years ago

jyson v4.1.1

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

jyson

This package lets you generate fast json templates for your apis. It lets you quickly build powerful api templates.

NPM Version Travis Build Status Coveralls NPM Downloads

Install

npm install jyson --save

Usage

jyson can create many different types of templates, for a full list of examples check out the example tests.

const jyson = require('jyson');

const productTemplateFunction = jyson.buildTemplateFunction({
  name: 'name',
  tags: ['meta.tags.$'],
  other: {
    dogRating: 'meta.rating',
    exampleMissingValue: 'notFound',
    dateRan: ({ templateOpts }) => templateOpts.dateRan
  }
});

const input = {
  name: 'Bacon Peanut Butter “Ice Cream” for Dogs',
  meta: {
    rating: 10,
    tags: [
      'lactobacillus bulgaricus',
      'enterocococcus thermophilus',
      'lactobacillus acidophilus',
      'bifidobacterium bifidum',
      'lactobacillus casei'
    ],
  }
};

const result = productTemplateFunction([input], {dateRan: 1496351371149});
// => [{
//  name: 'Bacon Peanut Butter “Ice Cream” for Dogs',
//  tags:[
//    'lactobacillus bulgaricus',
//    'enterocococcus thermophilus',
//    'lactobacillus acidophilus',
//    'bifidobacterium bifidum',
//    'lactobacillus casei'
//  ],
//  other: {
//    dogRating: 10,
//    exampleMissingValue: null,
//    dateRan: 1496351371149
//  }
//}]

Goals

  • Easy to install
  • Easy to understand
  • Make jyson part of the common lexicon

Contributing

Please read through our contributing guidelines. Included are directions for opening issues, coding standards, and notes on development.


Built with ❤️ at Hubba. Maintained with 💖 by earobinson.

4.1.1

5 years ago

4.1.0

5 years ago

4.0.1

6 years ago

4.0.0

6 years ago

3.1.3

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.0

6 years ago

1.3.0

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago