Skip to content

ppsreejith/dot-mustache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DotMustache

Allows you to access arrays and objects via dot notation.

const {parser} = require('dot-mustache');
parser('body.text.crit.[words,something.here]', {
  body: {
    text: [{
      crit: {
        words: ['This works', 'This too'],
        something: {
          here: 'here this works',
        },
      },
    }, {
      crit: [{
        words: 'still works',
        something: {
          here: 'here this works too',
        },
      }],
    }],
  },
});

This code snippet returns

[{
  'words': ['This works', 'This too'],
  'something.here': 'here this works'
} {
  'words': 'still works',
  'something.here': 'here this works too'
}]

About

Dot notation parser for Mustache

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors