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.
Blake can be used from the command-line or as library.
npm install -g blake
blake path/to/input path/to/output [path/to/input/file …]
The first parameter is the path to your input directory.
The second parameter is the path to your output directory. Please be warned that this directory is removed everytime a full generation of your site starts. You better not point it at your home directory—Blake doesn't provide safety net. If the output directory doesn't exist, Blake makes it.
blake input output
The optional third parameter is a list of filenames. While writing, you often times just want to quickly preview the page you're currently working on, thus you don't necessarily want to render your whole site. Let's say you're tweaking your about page and want to see it in the browser.
blake input output input/about.md
Or you may just want to compile your home and archive pages.
blake input output input/home.md input/archive.md
When Blake starts it requires a configuration module, which it expects to find at input/view/config.js. The configuration defines the conventions for accessing input data and exports a map of bake functions. In my opinion it makes sense to use template names as identifiers. Each of your views has to implement a bake function.
# This module covers configuration.
# Path conventions to use for input data.
exports.paths =
data: '/data',
templates: '/templates/',
resources: '/resources/',
posts: '/data/posts'
# Export map with bake functions by template names.
exports.bakeFunctions =
'rss.jade': require('./rss.js').bake,
'article.jade': require('./article.js').bake,
'home.jade': require('./home.js').bake,
'about.jade': require('./about.js').bake,
'archive.jade': require('./archive.js').bake
Of course you can always build your site locally and upload it to your webserver manually, but I recommend to run Blake on your server and use post-receive hooks to automatically generate your site on your server everytime you're pushing to your input data repository.
See LICENSE.
FAQs
Generate anything
The npm package blake receives a total of 30 weekly downloads. As such, blake popularity was classified as not popular.
We found that blake 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.
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.