Swarm.js is a JavaScript library designed to facilitate interaction with the Swarm network, a decentralized storage platform. The package provides functionalities for uploading and downloading files and directories to and from Swarm, as well as hashing various data types. It specifically targets both Node.js and browser environments for these operations. The current stable version appears to be 0.1.42, indicating it never reached a 1.0 release. The library's development has ceased, with the maintainer explicitly stating it is no longer actively maintained and recommending Erebos (https://erebos.js.org/) as an alternative. Therefore, users should be aware of its abandoned status and consider alternatives for new projects, or for maintaining existing ones.
npm install swarm-jsVerified import paths — ran on the pinned version, not inferred.
Demonstrates installation, configuration with a gateway, and basic upload/download operations for both single files and directories.
Migrate to an actively maintained alternative for Swarm interactions, such as Erebos (https://erebos.js.org/).
Use with extreme caution and be aware of potential issues; strongly consider actively maintained alternative libraries for any new or critical projects.
For Node.js, ensure your project is configured for CommonJS or use a bundler (e.g., Webpack, Rollup) for browser environments if you need ESM context. Always use `require()` as shown in the documentation.
Ensure you are using the CommonJS `require` syntax and calling the `.at()` method immediately: `const swarm = require('swarm-js').at('http://swarm-gateways.net');`Change `import` statements to `const swarm = require('swarm-js').at(...)` or configure your build process to transpile CommonJS modules for ESM consumption in an `ESM` project. If in an ES Module environment, you might need a wrapper or dynamic import if `require` is not available.Verify the Swarm gateway URL is correct and the gateway is operational and accessible from your network. Try a different public gateway URL if available, or ensure your firewall/network settings allow the connection.
No dependency data recorded yet.