diff --git a/lib/ejs.js b/lib/ejs.js index 04b9bcb6..b243fa76 100644 --- a/lib/ejs.js +++ b/lib/ejs.js @@ -52,6 +52,7 @@ var scopeOptionWarned = false; var _VERSION_STRING = require('../package.json').version; var _DEFAULT_DELIMITER = '%'; var _DEFAULT_LOCALS_NAME = 'locals'; +var _NAME = 'ejs'; var _REGEX_STRING = '(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)'; var _OPTS = [ 'cache', 'filename', 'delimiter', 'scope', 'context', 'debug', 'compileDebug', 'client', '_with', 'root', 'rmWhitespace', @@ -806,6 +807,16 @@ if (require.extensions) { exports.VERSION = _VERSION_STRING; +/** + * Name for detection of EJS. + * + * @readonly + * @type {String} + * @public + */ + +exports.name = _NAME; + /* istanbul ignore if */ if (typeof window != 'undefined') { window.ejs = exports; diff --git a/test/ejs.js b/test/ejs.js index b8cb4c9d..80e55a24 100644 --- a/test/ejs.js +++ b/test/ejs.js @@ -982,3 +982,13 @@ suite('examples', function () { }); }); }); + +suite('meta information', function () { + test('has a version', function () { + assert.strictEqual(ejs.VERSION, require('../package.json').version); + }); + + test('had a name', function () { + assert.strictEqual(ejs.name, 'ejs'); + }); +});