Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@alchemy-js/alchemy
Advanced tools
Readme
Alchemy is a static site generator for Node.js that's been heavily inspired by tools such as Metalsmith and Jekyll, but to be as dependency-light and efficiency focused as possible.
Featuring a "transmuter system" and a clean, chainable API, Alchemy allows users to create their own transmuter functions to take an input source and transmute it into something else. This is very useful and flexible when performing operations such as converting markdown to HTML, appending new YAML with an array of certain content, pre-processing Sass to CSS, file templating such as Handlebars, or really any other file manipulation that can be of use.
npm i @alchemy-js/alchemy --save
Alchemy's chainable API executes sychronously. It's also important to note that the order in which transmute functions are chained can impact the output, depending upon what the expected behavior of each function is. With this in mind, calls to transmute
adds the passed in function to a queue. Once the build
method is executed, Alchemy executes the contents of each transmute function from the previously created queue, following the FIFO (first in, first out) concept. For example, if a transmuter leverages a templating engine to convert Handlebars content to HTML and another transmuter is expecting the incoming file to already be an HTML document, then these must be in order, from top-down. If they were reversed, the process would fail.
src
and dest
pathsfile
, and done
parameters
file
is an object containing data related to the file that is currently being processed, specifically:
content
and data
key/values from the gray-matter
packagepath.prase
- specifically file dir
, name
, and ext
src
and dest
, the arguments passed to the Alchemy
functiondone
is a callback function that must be called once transmutations are completed
file
object. This transmuted data is then passed along to the next method in the chain
{ content: [string], data: [object], dir: [string], name: [string], ext: [string] }
dest
directory once the entire chain executes
{ ignore: [boolean] }
done()
with no arguments to continue the processdest
directoryconst Alchemy = require('@alchemy-js/alchemy');
Alchemy({ src: './data', dest: './public' })
.clean()
// optional transmute method accepts a closure to operate upon `{ file }` data,
// followed by calling `done()` to move to the next chained method
.transmute(foobar({
// some config data for the foobar func here
}))
.build()
.watch([
'./example/data',
'./example/layouts',
]);
const Alchemy = require('@alchemy-js/alchemy');
const extUpdater = (options) => {
const { find, replace } = options;
return (file, done) => {
if (file.ext === find) {
done({ ext: replace })
}
done()
}
}
Alchemy({ src: './data', dest: './public' })
.clean()
// extUpdater now changes each file extension from `.md` to `.html`
.transmute(extUpdater({
find: '.md',
replace: '.html',
}))
.build()
.watch([
'./example/data',
'./example/layouts',
]);
FAQs
A dependency-light static site generator
The npm package @alchemy-js/alchemy receives a total of 12 weekly downloads. As such, @alchemy-js/alchemy popularity was classified as not popular.
We found that @alchemy-js/alchemy 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.