
Company News
Socket Has Acquired Secure Annex
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.
escape-delims
Advanced tools
Escape and un-escape delimiters in templates. Tested with Lo-Dash, underscore and Handlebars syntax, but could be used with other template engines/syntaxes as well. This is similar to the process used by Yeoman on escaped templates in generators.
Escape and un-escape delimiters in templates. Tested with Lo-Dash, underscore and Handlebars syntax, but could be used with other template engines/syntaxes as well. This is similar to the process used by Yeoman on escaped templates in generators.
npm i escape-delims --save-dev
var EscapeDelims = require('escape-delims');
Create a new instance of EscapeDelims():
from {Array}: Optionally pass delimiters to use for escaping. Defaults to ['{%%', '%}'].to {Array}: Optionally pass delimiters to use for un-escaping. Defaults to ['{%%', '%}'].var EscapeDelims = require('escape-delims');
var escapeDelims = new EscapeDelims();
Optionally pass the "escape delimiters" to use as an array:
var escapeDelims = new EscapeDelims(['<%%', '%>']);
Escape the given str, optionally passing a delimiter syntax to use if not defined in the constructor.
str {String}: The string with delimiters to escape.from {Array}: The delimiter syntax to use.Example:
escapeDelims.escape('<%%= first %><%= last %>', ['<%%', '%>']);
//=> '(;^__^;) first (;\^_\^;)<%= last %>'
Un-escape previously escaped delimiters in the given str. Optionally pass the syntax to use if they have not already been defined.
str {String}: The string with delimiters that need to be escaped.to {Array}: The delimiter syntax to use for un-escaping.Example:
escapeDelims.unescape('(;^__^;) first (;\^_\^;)<%= last %>', ['<%%', '%>']);
//=> '<%= first %><%= last %>'
Jon Schlinkert
Copyright (c) 2014 Jon Schlinkert
Released under the MIT license
This file was generated by verb on November 11, 2014.
FAQs
Escape and un-escape delimiters in templates. Tested with Lo-Dash, underscore and Handlebars syntax, but could be used with other template engines/syntaxes as well. This is similar to the process used by Yeoman on escaped templates in generators.
The npm package escape-delims receives a total of 90 weekly downloads. As such, escape-delims popularity was classified as not popular.
We found that escape-delims demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.

Product
Reachability analysis for PHP is now available in experimental, helping teams identify which vulnerabilities are actually exploitable.