Registry / storage / write-file-queue

write-file-queue

JSON →
library0.0.1jsnpmunverified

A writeFile queue for Node.js that retries writing to a file after errors, with configurable retries and wait time. Version 0.0.1 is a minimal package released under MIT license. It is designed for simple scenarios where file writes may intermittently fail (e.g., writing to a removable device). The queue delays writes by a specified waitTime and retries up to retries times. No dependencies, no TypeScript support, and no active maintenance since 2014.

npm install write-file-queue
INSTALL
IMPORT
SIG · WRITE-FILE-QUEUE
W
write-file-queue
storagejavascriptv0.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

writeFile (factory result)
var writeFile = require('write-file-queue')(options);
var writeFileQueue = require('write-file-queue'); writeFileQueue(options);
The module exports a factory function that must be called with options to get a writeFile function.
default export (ESM)
import createWriteFile from 'write-file-queue'; const writeFile = createWriteFile(options);
import { writeFile } from 'write-file-queue';
No named exports; ESM support is not guaranteed as package is CJS-only.
writeFile callback
writeFile('/path', 'data', function(err) { /* handle err */ });
writeFile('/path', 'data').then(...);
The writeFile function uses callback pattern, not promises.

Shows how to install and use the package: create a queue with retries and waitTime, then write a file with retry logic.

var createWriteFile = require('write-file-queue'); var options = { retries: 10, waitTime: 500, debug: console.error }; var writeFile = createWriteFile(options); writeFile('/tmp/test.txt', 'Hello World', function (err) { if (err) { console.error('Write failed after retries:', err); } else { console.log('Write successful'); } });
Debug
Known issues
deprecatedPackage is unmaintained since 2014 and has no updates.
fix
Consider alternatives like fs-extra's writeFile or custom retry logic with modern async/await.
affects: all
gotchaThe factory function must be called with options object; passing null or invalid options will cause runtime errors.
fix
Always pass an options object with at least retries and waitTime.
affects: >=0.0.1
gotchaThe callback receives the last error after all retries fail; it does not provide intermediate errors.
fix
Use the debug option to log intermediate errors.
affects: >=0.0.1
Errors
Common errors & fixes
TypeError: createWriteFile is not a function
Using named import from an ESM environment on a CJS-only package, or calling require incorrectly.
fix
Use const createWriteFile = require('write-file-queue'); then call createWriteFile(options).
Error: Cannot find module 'write-file-queue'
Package not installed or not present in node_modules.
fix
Run: npm install write-file-queue
Upgrade
Version history
0.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
41 hits · last 30 days
node
34
OpenAI (training)
1
Resources
write-file-queue — npm install write-file-queue · libregistry