Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
bffs
BFFS (Build files finder service) is a module that helps with the storage and
retrieval of build files for warehouse.ai
.
It stores the build files and gzip version of the build file. In addition to that it also stores all meta for a given build so it can be retrieved again by searching for the spec it was build with (version, name and environment)
npm install --save bffs
In all API examples we assume that you've already created a new BFFS instance, this is how you setup a new instance:
'use strict';
const Redis = require('ioredis');
const BFFS = require('bffs');
const bffs = new BFFS({
store: new Redis()
});
As you can see in the example above, the constructor accepts a single options argument this options object can contain the following properties:
store
an ioredis
client instance that can be usedcache
Options that are directly passed in to the hotpath
module for
hotpath cache optimization.cdn
The root or prefix of the build files URL's.env
An array of environments that we support.Fetch a completed build file. The method requires the following arguments:
bffs.build('0810984t019823098d08a.js', false, function (err, data) {
});
Search for previously published builds of modules. This method accepts 3 arguments:
key
method to generate a
specific a key. Only used internallybffs.search({
name: 'wsb-pancakes',
version: '1.2.4',
env: 'test'
}, function (err, meta) {
});
Publish a new build, this does a couple of things. It stores the content
and compressed
keys as "build" files using the fingerprint
key as file name.
The rest of the data is stored as meta build data which should give some
detailed information about the build it self.
This method requires 3 arguments:
compressed
, content
and
fingerprint
as minimum requirements.
You don't need to add the name
, version
and env
properties to this
object as we will merge those in from the first supplied argument.bffs.publish({
name: 'wsb-pancakes',
version: '1.2.5',
env: 'test'
}, {
promote: false, // prevents creating BuildHead based on the created Build
files: [{
content: fs.readFileSync('file.js'),
compressed: fs.readFileSync('file.js.gz'),
fingerprint: fingerprinter(fs.readFileSync('file.js')).id
}]
}, function (err) {
});
Promotes the Build
defined by the given spec
(name
, env
, version
) to
be the BuildHead
for every locale it was built for. Useful for when a build
was published using promote: false
functionality.
bffs.promote({
name: 'my-package',
env: 'test',
version: '3.4.5'
}, (err) => {
if (err) return /* handle me */
})
Sets the current BuildHead
to the given name
, env
, and version
while
also setting keeping record of the prior build via rollbackBuildId.
bffs.rollback({
name: 'my-package',
env: 'test'
}, /* optional /* '1.5.6', (err) => {
if (err) return /* handle me */
})
Get all the meta data from a given build for every support environment. This method requires 2 arguments:
bffs.meta({
name: 'wsb-pancakes',
version: '1.1.1'
}, function (err, meta) {
});
Store the build id as indication that a given package is already building. The
build will stay active until the supplied timeout or stop
method has been
called. This method requires 4 arguments:
bffs.start({
name: 'wsb-pancakes',
version: '1.2.5',
env: 'test'
}, '98798ad0-afd7a0-afasdfas901', 27E2, function (err) {
});
Check if a given build set is active and returns the jobs
of the builds
if this is the case. It requires 2 arguments:
bffs.active({
name: 'wsb-pancakes',
version: '1.2.5',
env: 'test'
}, function (err, jobs) {
// jobs is an array with a `key` and `value` property.
// The `value` is the `id` of the job.
});
Stop and remove the indication that a build is running. It requires 2 arguments:
bffs.stop({
name: 'wsb-pancakes',
version: '1.2.5',
env: 'test'
}, function (err) {
});
Get running build information. It requires 2 arguments:
bffs.partial({
name: 'wsb-pancakes',
version: '1.2.5',
env: 'test'
}, function (err, job) {
});
Stop the build and clear it from cache. It requires 2 arguments:
bffs.wipe({
name: 'wsb-pancakes',
version: '1.2.5',
env: 'test'
}, function (err) {
});
A key/value database (i.e Redis or similar) should be running local.
docker pull redis:latest
npm run redis
Also run an AWS local cloud stack, pull latest
localstack.
This requires docker
to be setup.
docker pull localstack/localstack:latest
npm run localstack
Run tests in a separate terminal.
npm test
7.1.0
compressed
key not being provided at all.FAQs
build files finder service
The npm package bffs receives a total of 29 weekly downloads. As such, bffs popularity was classified as not popular.
We found that bffs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.