
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
pipelineThe happy path, presenting a series of dotchained functions, e.g.:
import * as begat from "begat"
begat
.pipeline([ /* a pipeline of generator functions */ ])
.withOptions({ /* the union of options for the composed generators */ })
.then( /* apply the result using the regular promises API */ )
composeComposes a pipeline of generators into... (you guessed it)...
(generators: Generator[]) => Generator
import * as begat from "begat"
const pipeline = begat.compose([ /* a pipeline of generator functions */ ])
const run = pipeline({ /* the union of options for the composed generators */ })
run( /* use the default context, or create one explicitly */ )
.then( /* apply the result */ )
ContextA chunk of state that gets passed down the pipeline of generators.
Notably includes a memfs volume.
Generator(options?: Options) => Context => Promise<Context>
Takes some options, and does useful work to the passed context.
Basically a function that modifies a volume in some way.
OptionsOptions are whatever your generators collectively need them to be. The type of each generator is parameterised by the type of its individual options, and the options type of a composition of generators is the union of those options.
The intention is that options are reused within ecosystems of generators — i.e. you should design your generator's options in such a way that people you haven't met could write their own generators which extend yours in ways you hadn't considered.
General-purpose generators and utilities, as a stepping-off point for building other generators.
begat/std/clone (generator)Copies the contents of the current directory to the root of the volume.
A good first step in a generator pipeline which modifies an existing project.
begat/std/template (generator)Renders eta templates (similar to ejs) to the output volume.
See the example workspaces for an example based on this generator.
begat/std/aside (generator)(fn: (context: Context) => void) => Generator
Runs the passed function on a deep copy of the context. Useful for debugging pipelines, e.g.:
begat.compose([
clone,
buggyGenerator,
aside(({ volume }) => console.log(volume.toJSON())),
anotherGenerator,
])
begat/std/diffOpen your git difftool, comparing the state of the volume against your working directory.
import * as begat from "begat"
import { diff } from "begat/std/diff"
begat
.pipeline([ ... ])
.withOptions({ ... })
.then(diff)
begat/std/writeCopy all files from the root of the volume into your working directory.
import * as begat from "begat"
import { write } from "begat/std/write"
begat
.pipeline([ ... ])
.withOptions({ ... })
.then(write)
FAQs
Build families of composable project (re-)generators đź“–
The npm package begat receives a total of 0 weekly downloads. As such, begat popularity was classified as not popular.
We found that begat 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 researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.