jstransformer-ejs
Advanced tools
Comparing version 0.0.3 to 0.2.0
28
index.js
@@ -1,18 +0,18 @@ | ||
'use strict'; | ||
'use strict' | ||
var ejs = require('ejs'); | ||
var fs = require('fs'); | ||
const fs = require('fs') | ||
const ejs = require('ejs') | ||
exports.name = 'ejs'; | ||
exports.outputFormat = 'html'; | ||
exports.compile = ejs.compile; | ||
exports.name = 'ejs' | ||
exports.outputFormat = 'html' | ||
exports.compile = ejs.compile | ||
exports.compileClient = function (source, options) { | ||
options = options || {}; | ||
options.client = true; | ||
return exports.compile(source, options).toString(); | ||
}; | ||
options = options || {} | ||
options.client = true | ||
return exports.compile(source, options).toString() | ||
} | ||
exports.compileFile = function (path, options) { | ||
options = options || {}; | ||
options.filename = options.filename || path; | ||
return exports.compile(fs.readFileSync(path, 'utf8'), options); | ||
}; | ||
options = options || {} | ||
options.filename = options.filename || path | ||
return exports.compile(fs.readFileSync(path, 'utf8'), options) | ||
} |
{ | ||
"name": "jstransformer-ejs", | ||
"version": "0.0.3", | ||
"description": "Transform EJS template into HTML.", | ||
"version": "0.2.0", | ||
"description": "EJS support for JSTransformers.", | ||
"keywords": [ | ||
@@ -9,14 +9,20 @@ "jstransformer", | ||
], | ||
"files": [ | ||
"index.js" | ||
], | ||
"dependencies": { | ||
"ejs": "^2.2.4" | ||
"ejs": "^2.5.7" | ||
}, | ||
"devDependencies": { | ||
"coveralls": "^2.11.2", | ||
"istanbul": "^0.3.5" | ||
"test-jstransformer": "^1.0.0", | ||
"xo": "*" | ||
}, | ||
"scripts": { | ||
"test": "node test", | ||
"coverage": "istanbul cover test", | ||
"coveralls": "npm run coverage && cat ./coverage/lcov.info | coveralls" | ||
"coverage": "test-jstransformer coverage", | ||
"test": "test-jstransformer", | ||
"posttest": "xo --space --no-semicolon index.js" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"repository": { | ||
@@ -26,4 +32,7 @@ "type": "git", | ||
}, | ||
"author": "Timothy Gu <timothygu99@gmail.com>", | ||
"author": { | ||
"name": "JSTransformers Team", | ||
"url": "http://github.com/orgs/jstransformers/people" | ||
}, | ||
"license": "MIT" | ||
} |
# jstransformer-ejs | ||
Transform EJS templates into HTML | ||
[EJS](https://github.com/mde/ejs) support for [JSTransformers](http://github.com/jstransformers). | ||
[![Build Status](https://img.shields.io/travis/jstransformers/jstransformer-ejs/master.svg)](https://travis-ci.org/jstransformers/jstransformer-ejs) | ||
[![Dependency Status](https://img.shields.io/david/jstransformers/jstransformer-ejs.svg)](https://david-dm.org/jstransformers/jstransformer-ejs) | ||
[![Coverage Status](https://img.shields.io/coveralls/jstransformers/jstransformer-ejs/master.svg)](https://coveralls.io/r/jstransformers/jstransformer-ejs?branch=master) | ||
[![Coverage Status](https://img.shields.io/codecov/c/github/jstransformers/jstransformer-ejs/master.svg)](https://codecov.io/gh/jstransformers/jstransformer-ejs) | ||
[![Dependency Status](https://img.shields.io/david/jstransformers/jstransformer-ejs/master.svg)](http://david-dm.org/jstransformers/jstransformer-ejs) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/jstransformers/jstransformer-ejs.svg)](https://greenkeeper.io/) | ||
[![NPM version](https://img.shields.io/npm/v/jstransformer-ejs.svg)](https://www.npmjs.org/package/jstransformer-ejs) | ||
@@ -14,4 +15,13 @@ | ||
## API | ||
```js | ||
var ejs = require('jstransformer')(require('jstransformer-ejs')) | ||
ejs.render('Hello <%= name %>!', {name: 'World'}).body | ||
//=> 'Hello World!' | ||
``` | ||
## License | ||
MIT |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
27
1
3830
5
1
80
16
Updatedejs@^2.5.7