
Research
wget to Wipeout: Malicious Go Modules Fetch Destructive Payload
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
ipfs-unixfs-engine
Advanced tools
JavaScript implementation of the layout and chunking mechanisms used by IPFS to handle Files
> npm install ipfs-unixfs-engine
The unixfs-engine
exports the unixfs-importer
and unixfs-exporter
modules. Please see those modules for for full documentation.
The importer is a pull-stream through which takes objects of the form { path, content }
where path
is a string path and content
can be a Buffer
, a ReadableStream
or a pull-stream
that emits Buffer
s.
It requires an ipld resolver to persist DAGNodes and make them available over IPFS.
See the unixfs-importer
module for full documentation.
const {
importer
} = require('ipfs-unixfs-engine')
const pull = require('pull-stream')
const fs = require('fs')
// Import path /tmp/bar.txt
pull(
pull.values([{
path: '/tmp/bar.txt',
content: fs.createReadStream('/tmp/bar.txt')
}]),
// You need to create and pass an ipld resolver instance
// https://npmjs.com/packages/ipld
importer(<ipld-resolver instance>, <options>),
// Handle the error and do something with the results
pull.collect((err, files) => {
console.info(files)
// Prints:
// [{
// size: 12,
// leafSize: 4,
// multihash: <Buffer>
// path: '/tmp/bar.txt',
// name: ''
// }, {
// path: 'tmp',
// multihash: <Buffer>
// size: 65
// }]
})
)
The exporter is a pull-stream source which takes a cid and an ipld resolver.
See the unixfs-exporter
module for full documentation.
const {
exporter
} = require('ipfs-unixfs-engine').exporter
const pull = require('pull-stream')
const drain = require('pull-stream/sinks/drain')
pull(
// You need to create and pass an ipld resolver instance
// https://npmjs.com/packages/ipld
exporter(cid, ipld),
drain((file) => {
// file.content is a pull stream containing the bytes of the file
})
)
Feel free to join in. All welcome. Open an issue!
This repository falls under the IPFS Code of Conduct.
0.35.2 (2018-11-29)
<a name="0.35.1"></a>
FAQs
JavaScript implementation of the unixfs Engine used by IPFS
The npm package ipfs-unixfs-engine receives a total of 610 weekly downloads. As such, ipfs-unixfs-engine popularity was classified as not popular.
We found that ipfs-unixfs-engine 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
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.
Product
We redesigned Socket's first logged-in page to display rich and insightful visualizations about your repositories protected against supply chain threats.