
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
@fastly/js-compute
Advanced tools
JavaScript SDK and CLI for building JavaScript applications on [Fastly Compute](https://www.fastly.com/products/edge-compute/serverless).
JavaScript SDK and CLI for building JavaScript applications on Fastly Compute.
We recommend using the Fastly CLI to create, build, and deploy JavaScript Fastly Compute services, as described on the Fastly Developer Hub.
Detailed documentation for JavaScript Fastly Compute services is also available on Fastly Developer Hub.
The Fastly Developer Hub has a collection of example JavaScript applications.
Here is a small example application:
/// <reference types="@fastly/js-compute" />
async function app(event) {
const request = event.request;
return new Response(`You made a request to ${request.url}`)
}
addEventListener("fetch", event => {
event.respondWith(app(event));
});
The CLI is typically invoked by the build script defined in your project's package.json scripts.
{
"scripts": {
"build": "js-compute-runtime src/index.js bin/main.wasm"
}
}
The CLI is invoked as follows:
js-compute-runtime [OPTIONS] <input-js-file> <output-wasm-file>
Options can be specified on the command line or added to a persistent configuration file for the project. The CLI will search for a configuration starting from the current directory in the following order:
fastlycompute property in package.json.fastlycomputerc.jsonfastlycompute.config.jsThe CLI will search for a configuration starting from the current directory in the following order:
fastlycompute property in package.json.fastlycomputerc (JSON or YAML).fastlycomputerc.json, .fastlycomputerc.yaml, .fastlycomputerc.yml.fastlycomputerc.js, .fastlycomputerc.mjsfastlycompute.config.js, fastlycompute.config.mjsIf an option is defined in both the command line and the configuration file, the command line option takes precedence.
| Config Key | CLI Flag | Type | Description |
|---|---|---|---|
enableAOT | --enable-aot | boolean | Enable AOT compilation for performance |
aotCache | --aot-cache | string (path) | Specify a path to the AOT cache file |
enableHttpCache | --enable-http-cache | boolean | Enable the HTTP cache hook API |
enableExperimentalHighResolutionTimeMethods | --enable-experimental-high-resolution-time-methods | boolean | Enable experimental fastly.now() method |
enableExperimentalTopLevelAwait | --enable-experimental-top-level-await | boolean | Enable experimental top level await |
enableStackTraces | --enable-stack-traces | boolean | Enable stack traces |
excludeSources | --exclude-sources | boolean | Don't include sources in stack traces |
debugIntermediateFiles | --debug-intermediate-files | string (path) | Output intermediate files in directory |
debugBuild | --debug-build | boolean | Use debug build of the SDK runtime |
engineWasm | --engine-wasm | string (path) | Specify a custom Wasm engine (advanced) |
wevalBin | --weval-bin | string (path) | Specify a custom weval binary (advanced) |
env | --env | string | object | array | Set environment variables, possibly inheriting from the current environment. Multiple variables can be comma-separated (e.g., --env ENV_VAR,OVERRIDE=val) |
NOTE: The env field is additive. Values defined on the command-line values append to, rather than replace, the values defined in any configuration file.
js-compute-runtime --enable-aot --enable-stack-traces --enable-top-level-await --env=LOG_LEVEL=debug ./src/index.js ./bin/main.wasm
.fastlycomputerc.json{
"enableAOT": true,
"enableStackTraces": true,
"enableTopLevelAwait": true,
"env": {
"LOG_LEVEL": "debug"
}
}
package.json{
"name": "my-fastly-service",
"type": "module",
"dependencies": {
"@fastly/cli": "^13.0.0"
},
"scripts": {
"build": "js-compute-runtime ./src/index.js ./bin/main.wasm",
"dev": "fastly compute serve",
"deploy": "fastly compute publish"
},
"fastlycompute": {
"enableAOT": true,
"enableStackTraces": true,
"enableTopLevelAwait": true,
"env": {
"LOG_LEVEL": "debug"
}
}
}
The API documentation for the JavaScript SDK is located at https://js-compute-reference-docs.edgecompute.app.
If you find any security issues, see the Fastly Security Reporting Page or send an email to: security@fastly.com
We plan to disclose any found security vulnerabilities per the GitHub security vulnerability guidance. Note that communications related to security issues in Fastly-maintained OSS as described here are distinct from Fastly security advisories.
The changelog can be found here.
FAQs
JavaScript SDK and CLI for building JavaScript applications on [Fastly Compute](https://www.fastly.com/products/edge-compute/serverless).
The npm package @fastly/js-compute receives a total of 122,004 weekly downloads. As such, @fastly/js-compute popularity was classified as popular.
We found that @fastly/js-compute demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 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
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.