🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

boot-tasks

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boot-tasks

Simple nodejs boot tasks manager. Executes a list of tasks, sync or async. That's all.

0.1.3
latest
Source
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

boot-tasks

Simple nodejs boot tasks manager. Executes a list of tasks, sync or async. That's all.

## Usage example in CoffeeScript:

BootTasks = require 'boot-tasks'

# Set final callback
tasks = new BootTasks ->
  console.log " [*] Server %s listening on %s:%d"
    , server.nodename
    , argv.host
    , argv.port
  server.listen argv.port, argv.host

# Set sync mode
tasks.sync()

# Add a task: redis
tasks.task ->
  redisClient = redis.createClient config.redis.port
    , config.redis.host
    , config.redis.params

  redisClient.on 'ready', ->
    console.log " [ ] redisClient ready"
    tasks.done()

# Run tasks
tasks.do()

Functions

Constructor

BootTasks = require 'boot-tasks'
tasks = new BootTasks(end)

Optional end parameter as a function to call at the end.

.sync() and .async()

Set the execution mode. Default: sync

.on('done', callback) or .ondone(callback)

Function callback to call at the end.

.task(func)

Add a func function as a task.

.done()

Call at the end of every task to continue execution (only sync mode).

.do(context)

Process all the tasks. Optional context parameter for the tasks.

To-Do

  • Dependency management
  • done function as a parameter
  • Emit events
  • Tests

Keywords

tasks

FAQs

Package last updated on 20 Feb 2014

Did you know?

Socket

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.

Install

Related posts