Registry / devops / fracture

fracture

JSON →
library0.2.0jsnpmunverified

Fracture is a Node.js error-first callback work queue that splits work on a hashed key, providing deterministic execution order and backpressure handling. The current stable version is 0.2.0, with a slow release cadence (last updated 2018). Unlike generic queues (e.g., async.queue), Fracture groups tasks by key, ensuring tasks with the same key execute serially while different keys can run concurrently. It supports error-first callbacks and custom concurrency limits.

npm install fracture
INSTALL
IMPORT
SIG · FRACTURE
F
fracture
devopsjavascriptv0.2.0
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.

Fracture
import { Fracture } from 'fracture'
const Fracture = require('fracture').Fracture
Default export is not available; use named import.
create
import { create } from 'fracture'
const { create } = require('fracture')
ESM import for factory function.
Queue
import { Queue } from 'fracture'
const Queue = require('fracture').Queue
Queue is a class exported as a named export.

Creates a fracture queue with concurrency 2, pushes three jobs where keys 'a' are serial and 'b' parallel, then starts processing.

import { create } from 'fracture'; const queue = create({ concurrency: 2 }); function worker(task, callback) { console.log('Processing:', task.key, task.data); callback(); } queue.push({ key: 'a', data: 'Job 1' }, worker); queue.push({ key: 'a', data: 'Job 2' }, worker); queue.push({ key: 'b', data: 'Job 3' }, worker); queue.on('drain', () => console.log('All done')); queue.start();
Debug
Known issues
deprecatedPackage is unmaintained since 2018. Use async.queue or p-queue for active support.
fix
Migrate to p-queue or async.queue.
affects: >=0.1.0
breakingIn version 0.2.0, the 'start()' method is required to begin processing; no auto-start.
fix
Call queue.start() after pushing all jobs.
affects: 0.2.0
gotchaTasks must have a 'key' property for proper queue splitting; otherwise they will be grouped under undefined.
fix
Always include a 'key' string in the task object.
affects: >=0.1.0
deprecatedThe library uses error-first callbacks; no Promise support built-in.
fix
Wrap callbacks in promises or use a promisify wrapper.
affects: >=0.1.0
Errors
Common errors & fixes
TypeError: queue.push is not a function
Using the Fracture constructor directly instead of create factory.
fix
Use create() to get the queue instance.
Cannot find module 'fracture'
Package not installed or ESM import misconfigured in CJS project.
fix
npm install fracture and use require('fracture') in CommonJS.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
fracture — npm install fracture · libregistry