delimiters
Set and get custom template delimiters.
Last updated 10 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install delimiters 
SYNC missed versions from official npm registry.

delimiters NPM version

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.

Current Tags

  • 1.0.1                                ...           latest (10 years ago)

5 Versions

  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.1.2                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 5
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE