Skip to content

plan3/render-jayson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RenderJSON

Simple tool to render valid JSON from a valid JSON template

Installation

$ npm install render-jayson

Features

  • Simple

  • Use valid JSON as a template

  • Use custom right and left delimiters (different or the same)

  • Possibility to define common params once and overwrite on each render

  • Use value if variable fills whole string:

    • template:

      {
          person: '${personalData}'
      }
    • params:

      {
          personalData: {
              name: 'John',
              age: 30,
              male: true
          }
      }
    • result:

      {
          person: {
              name: 'John',
              age: 30,
              male: true
          }
      }
  • Stringify values if inside string

    • template:

      {
          person: 'Personal data: ${personalData}'
      }
    • params:

      {
          personalData: {
              name: 'John',
              age: 30,
              male: true
          }
      }
    • result:

      {
          person: 'Personal data: {"name":"John","age":30,"male":true}'
      }

Examples

Tests

$ npm test

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published