Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
The perfect middleware between your static file server and the browser. Minifies, compresses, and caches files served to the client. If it's JS or CSS, it also transpiles unsupported features of the target browser. You may also use this in your build process to create browser-specific builds. It's traceur and myth on steroids.
The goal of this project is to create a frontend flow where:
Combined with polyfills, you can use most of the latest features of browsers with relative ease.
There's no:
Features:
var Ecstacy = require('ecstacy')
The cache folder where all the transpiled JS, minified, and gzipped files are saved.
This build folder is global, but because code is cached based on a
sha256
sum, there should not be any conflicts.
Delete the entire cache folder.
Per-file lru
cache options. Defaults to:
max
- 100
maxAge
- Infinity
These cache useragent -> transforms
lookups per instance.
Each cached object is pretty low memory since they are simply references to objects already in memory.
All Ecstacy
constructors have the following API:
Create a new instance. Some options are:
name
- the name of the file, specifically for source mapsmap
- the source map, if any"Builds" a version of the file according to agents
.
agents
is simply passed tp polyfills-db.
data
is an object with the following properties:
name
- the name of the file of the builddate
- the date this build was created for Last-Modified
headershash
- a sha256
sha sum of the JS file in hex
encoding for ETag
headerstransforms[]
- an array of all the transform names usedlength[extension]
- the byte size of each build for Content-Length
headersRead a file by its data.name
and extension
.
Returns a Buffer
, so you need to .toString()
it yourself.
var ecstacy = Ecstacy(code)
ecstacy.build(useragent).then(function (data) {
return ecstacy.read(data.name, '.js', 'utf8')
}).then(function (js) {
})
You may want to serve the smallest of data.length['.min.js.gz']
and data.length['.min.js']
if you like to over-optimize.
You also probably don't need to stringify the buffer to send it to the client.
Create a read stream for a file and extension instead of buffering it. Useful when serving files to the client.
Minify the asset and add its content length to data.length
.
Minify an already existing file by its name and extension,
and add its content length to data.length
.
Some additional options are:
code
- the JS codeSome additional fields:
transforms[]
- an array of all the transform names usedAll the possible extensions:
.json
- the returns data.js
.js.gz
.js.map
.js.map.gz
.min.js
.min.js.gz
.min.js.map
.min.js.map.gz
FAQs
transpile JS based on user agents
The npm package ecstacy receives a total of 1 weekly downloads. As such, ecstacy popularity was classified as not popular.
We found that ecstacy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.