$ npm install strings-parser-date
Parser for strings to handle date parsing.
Install with npm:
npm i strings-parser-date --save
Add as a strings
parser:
var Strings = require('strings');
var date = require('strings-parser-date');
var strings = new Strings();
strings.parser('date', date());
var context = {
date: '2014-MAY-15'
};
var template = ':YYYY';
var str = strings.template(template, 'date', context);
// expected: '2014'
console.log(str);
Brian Woodward
Copyright (c) 2014 Brian Woodward, contributors.
Released under the MIT license
This file was generated by verb-cli on May 15, 2014.
© 2010 - cnpmjs.org x YWFE | Home | YWFE