Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A browserify transform for turning .jade files into template functions
Jadeify lets you use Jade templates with browserify in the simplest way possible:
var template = require("./template.jade");
document.getElementById("my-thing").innerHTML = template({
localVar: "value",
anotherOne: "another value"
});
When creating your browserify bundle, just add this line:
bundle.transform(require("jadeify"));
or if you are a command line cowboy, something along the lines of
browserify -t jadeify entry.js -o bundle.js
Note that this project peer-depends on Jade and each template will do require("jade/runtime")
, so everything will just work: there's no need to add any Jade-related stuff to your bundle manually. (See below if your need to customize this.)
So yeah, now require
ing any .jade
files will give you back a template function. Have fun!
As with most browserify transforms, you can configure jadeify via the second argument to bundle.transform
:
bundle.transform(require("jadeify"), { compileDebug: true, pretty: true });
or inside your package.json
configuration:
{
"name": "my-spiffy-package",
"browserify": {
"transform": [
["jadeify", { "compileDebug": true, "pretty": true }]
]
}
}
Most options given to jadeify will be passed through to Jade's API.
runtimePath
optionThere is one additional option, runtimePath
, which can be used to customize the require
statement inserted at the top of every resulting template. If supplied, instead of require("jade/runtime")
, the given module ID will be required.
This can be useful if you are using jadeify as a dependency in a standalone library. For example, if your package demo-package
depends on both jade
and jadeify
, you can do
bundle.transform(require("jadeify"), { runtimePath: require.resolve("jade/runtime") });
inside your package. If your package is then located at node_modules/demo-package
, and thus its jade
dependency is located at node_modules/demo-package/node_modules/jade
, this will ensure that the template files output by your library contain the equivalent of require("demo-package/node_modules/jade/runtime")
, instead of the default require("jade/runtime")
. This way your library completely encapsulates the presence of Jade, and doesn't require its installation at top level.
FAQs
A browserify transform for turning .jade files into template functions
The npm package ix-jadeify receives a total of 0 weekly downloads. As such, ix-jadeify popularity was classified as not popular.
We found that ix-jadeify demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.