
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@yaro.page/nano-queue
Advanced tools
A lightweight, cross-platform task manager inspired by Celery for JavaScript environments
A lightweight, cross-platform task manager inspired by Celery for JavaScript environments. Nano-Queue provides asynchronous task execution, worker management, and queue processing for both Node.js and browser environments.
npm install nano-queue
import Queue from 'nano-queue'
// Create a Queue instance
const queue = new Queue()
// Define a task
const addTask = queue.task('add')((x, y) => x + y)
// Start workers
await queue.startWorkers(2)
// Execute task
const result = addTask.delay(5, 3)
// Wait for result
setTimeout(() => {
if (result.ready()) {
console.log('Result:', result.get()) // Output: 8
}
}, 1000)
import Queue from 'nano-queue'
// Create queue with custom logger level
const queue = new Queue({ logLevel: 'debug' })
// Define async task with options
const processDataTask = queue.task('process_data', {
retry: 3,
countdown: 2
})(async (data) => {
// Simulate processing
await new Promise(resolve => setTimeout(resolve, 1000))
return `Processed: ${data}`
});
// Start workers for specific queues
await queue.startWorkers(3, ['data_processing', 'default'])
// Send task to specific queue with options
const result = queue.sendTask('process_data', ['important_data'], {}, {
queue: 'data_processing',
countdown: 5,
retry: true
})
// Monitor queue status
console.log(queue.getQueueStatus())
Main class for managing tasks and workers.
new Queue(options)
options.logLevel - Logging level ('debug', 'info', 'warn', 'error')task(name, options) - Create a task decoratorsendTask(taskName, args, kwargs, options) - Send task to queuestartWorkers(count, queues) - Start worker processesstopAllWorkers() - Stop all workersgetQueueStatus() - Get queue status informationgetResult(taskId) - Get task result by IDRepresents an executable task.
delay(...args) - Execute task with argumentsapplyAsync(args, kwargs, options) - Execute with detailed optionsexecute(args, kwargs) - Direct task executionRepresents the result of task execution.
ready() - Check if task is completedsuccessful() - Check if task succeededfailed() - Check if task failedget() - Get task result (throws if failed/not ready)Processes tasks from queues.
start() - Start processing tasksstop() - Stop the workerprocessTask(taskMessage) - Process a single taskconst task = queue.task('my_task', {
retry: 3, // Number of retry attempts
countdown: 5, // Delay before execution (seconds)
expires: 3600 // Task expiration time
});
const result = queue.sendTask('task_name', [arg1, arg2], {}, {
queue: 'priority', // Target queue
countdown: 10, // Execution delay
retry: true, // Enable retries
maxRetries: 5 // Maximum retry attempts
});
import Queue from 'nano-queue'
// or
import { Queue } from 'nano-queue'
// Works with Webpack, Rollup, Vite, etc.
const unstableTask = queue.task('unstable', { retry: 3 })(() => {
if (Math.random() < 0.7) {
throw new Error('Random failure')
}
return 'Success!'
})
const result = unstableTask.delay()
// High priority queue
const urgentTask = queue.task('urgent_task')((data) => {
return `Urgent: ${data}`
})
// Normal priority queue
const normalTask = queue.task('normal_task')((data) => {
return `Normal: ${data}`
})
// Start specialized workers
await queue.startWorkers(2, ['urgent']) // 2 workers for urgent queue
await queue.startWorkers(1, ['normal']) // 1 worker for normal queue
// Send tasks to different queues
queue.sendTask('urgent_task', ['critical_data'], {}, { queue: 'urgent' })
queue.sendTask('normal_task', ['regular_data'], {}, { queue: 'normal' })
const scheduledTask = queue.task('scheduled')((message) => {
console.log(`Executed at: ${new Date()}`)
return message
})
// Execute after 30 seconds
const result = scheduledTask.applyAsync(['Hello World'], {}, { countdown: 30 })
npm test # Run tests
npm run test:watch # Watch mode
npm run test:coverage # With coverage report
Enable debug logging:
const queue = new Queue({ logLevel: 'debug' })
// Or change level later
queue.setLogLevel('debug')
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️
FAQs
A lightweight, cross-platform task manager inspired by Celery for JavaScript environments
The npm package @yaro.page/nano-queue receives a total of 3 weekly downloads. As such, @yaro.page/nano-queue popularity was classified as not popular.
We found that @yaro.page/nano-queue demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.