Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
bake is a template engine for static text files. It is something like Tom Preston-Werner's jekyll, but it is independent of file types and markup languages.
It allows you to apply JavaScript templates to any type of text file. These templates are written in embedded JavaScript.
npm install bake
A template (default.tpl
) may look like this:
<!DOCTYPE html>
<html lang="<%= lang %>">
<head>
<meta charset="utf-8">
<title><%- title %> | <%= siteTitle %></title>
</head>
<body>
<h1><%- title %></h1>
<%- __content %>
<% if (locals.foo) { %>
<p>Foo is defined.</p>
<% } %>
</body>
</html>
And a corresponding content file (post.txt
) could look like this:
title: A sample file
lang: en
<p>Sample text.</p>
With a minimal configuration object
{
"fileExtensions": {
"txt": "html" // look for html files and save as html file
},
"properties": {
"siteTitle": "My Site" // Global website title
}
}
the output (post.html
) would be:
<!DOCTYPE>
<html lang="en">
<head>
<meta charset="utf-8">
<title>A sample file | My Site</title>
</head>
<body>
<h1>A sample file</h1>
<p>Sample text.</p>
</body>
</html>
bake not only enables building websites (although that’s its main purpose) but lets you choose. You can write hooks for each property to control the output.
Visit the Wiki for more information or look at the example.
bake is not a webserver nor comes with one. It doesn't replace your
Apache/Nginx etc. So if you want to write a website that is accessible by the
public, you have to change the settings of your webserver to use bakeDir
as
the root directory.
bake is no blogging engine (although it's possible to create one with the help of bake). It doesn't provide generating an index or a feed. It doesn't have any commenting functionality either. If you are looking for a system with these features, try bread which is based on bake.
If you encounter any bugs or issues, feel free to open an issue at github.
This work was inspired by heimweh by Benjamin Birkenhake and txtracer by Konstantin Weiss, but also by wheat by Tim Caswell and jekyll by Tom Preston-Werner.
Copyright © 2011-2012 Paul Vorbach
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
static file bakery
The npm package bake receives a total of 15 weekly downloads. As such, bake popularity was classified as not popular.
We found that bake 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.