Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
little-network-box
Advanced tools
A little toolkit for distributed applications based on Hypercore.
$ npm install jwerle/little-box # from github for now
WIP
const { Origin, Sink, storage } = require('little-box')
const pump = require('pump')
const path = require('path')
const ram = require('random-access-memory')
const raf = require('random-access-file')
const fs = require('fs')
const video = path.resolve(__dirname, 'video.mp4')
const copy = path.resolve(__dirname, 'copy.mp4')
const origin = new Origin(ram)
origin.ready(() => {
const input = origin.createWriteStream()
const video = fs.createReadStream(video, { highWaterMark: 1024 })
const sink = new Sink(storage.sink(copy), origin.key, {
encryptionKey: origin.encryptionKey,
nonce: origin.nonce
})
pump(video, input, (err) => {
sink.on('sync', ()=> {
if (sink.byteLength === origin.byteLength) {
console.log('sync')
sink.close()
origin.close()
process.nextTick(process.exit)
}
})
})
})
Below is the documentation for the modules, classes, functions, and
constants little-box
exports publically.
Box(storage, key, options)
TBA
const { Box, codecs, hooks } = require('little-box')
const ready = require('hypercore-ready')
const nonce = crypto.randomBytes(24)
const box = new Box('./path/to/box', {
nonce, codec: codecs.xsalsa20
})
box.ready(() => {
const vault = new Box('./path/to/secure/vault', box.key)
const message = Buffer.from('hello')
const unboxed = new Box('./path/to/unboxed', {
nonce, hooks: [ hooks.xsalsa20 ]
})
box.append(message, () => {
box.head(console.log) // hello
})
box.update(() => {
ready(vault, unbox, () => {
replicate(box, vault, () => {
vault.head(console.log) // <ciphertext>
replicate(vault, unbox, () => {
unbox.head(console.log) // hello
})
})
})
})
})
Node(storage, key, options)
TBA
Edge(storage, key, options)
TBA
Origin(storage, key, options)
TBA
Reader(storage, key, options)
TBA
Receive(storage, key, options)
TBA
Send(storage, key, options)
TBA
Network(opts)
TBA
replicate(...boxes[, options[, callback]])
TBA
codecs
TBA
codecs.xsalsa20
TBA
hooks
TBA
hooks.xsalsa20
TBA
storage
TBA
storage.sink
TBA
MIT
FAQs
A little toolkit for distributed applications.
The npm package little-network-box receives a total of 0 weekly downloads. As such, little-network-box popularity was classified as not popular.
We found that little-network-box demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.