delimiters
v1.0.1
Published
Set and get custom template delimiters.
Downloads
1,991
Readme
delimiters
Set and get custom template delimiters.
Install with npm
npm i delimiters --save
Usage
var delimiters = require('delimiters');
API
Delimiters
Create a new instance of Delimiters
, optionally passing default options
to use.
options
{Object}: Options to use.
Example:
var Delimiters = require('delimiters');
var delimiters = new Delimiters();
.makeDelims
Pass custom delimiters to Lo-Dash.
arr
{Array}: Array of delimiters.settings
{Object}: Override specific generated delimiters with custom values.
Example:
delims.makeDelims(['${', '}'], {
// override the generated regex
interpolate: /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g
});
.setDelims
Cache delimiters by ext
with the given options
for later use.
ext
{String}: The name to use for the stored delimiters.arr
{Array}: Array of delimiter strings.
Example:
delims.setDelims('curly', ['{%', '%}']);
delims.setDelims('angle', ['<%', '%>']);
delims.setDelims('es6', ['${', '}'], {
// override the generated regex
interpolate: /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g
});
.useDelims
Specify by ext
the delimiters to make active.
ext
{String}
delimiters.useDelims('curly');
delimiters.useDelims('angle');
Author
Jon Schlinkert
License
Copyright (c) 2014-2015 Jon Schlinkert
Released under the MIT license
This file was generated by verb on February 02, 2015.