
Research
TeamPCP-Linked Supply Chain Attack Hits SAP CAP and Cloud MTA npm Packages
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.
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 Buffers.
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.
FAQs
JavaScript implementation of the unixfs Engine used by IPFS
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
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.