strings-parser-date

Parser for strings to handle date parsing.

2 个版本
安装
npm install strings-parser-date
yarn add strings-parser-date
pnpm add strings-parser-date
bun add strings-parser-date
README

strings-parser-date NPM version

Parser for strings to handle date parsing.

Install

Install with npm:

npm i strings-parser-date --save

Usage

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);

Author

Brian Woodward

License

Copyright (c) 2014 Brian Woodward, contributors.
Released under the MIT license


This file was generated by verb-cli on May 15, 2014.

版本列表
0.1.1 2015-07-09
0.1.0 2014-05-16