load-cakefile
Load or require the contents of Cakefiles
Last updated 6 years ago by jsdf .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install load-cakefile 
SYNC missed versions from official npm registry.

load-cakefile

loads/requires tasks and exports from a Cakefile (because normal require() doesn't work with Cakefiles)

Example


loadCakefile = require 'load-cakefile'

# get logical contents of specified Cakefile including task definitions
loadCakefile.load('./Cakefile')
# { tasks:
#    { 'build:lib':
#       { name: 'build:lib',
#         description: 'build client lib',
#         action: [Function] },
#      'build:ui':
#       { name: 'build:ui',
#         description: 'build client ui',
#         action: [Function] },
# ...

# just get tasks
tasks = loadCakefile.tasks('./Cakefile')
# run a task
tasks['build:ui'].action(options)

# just get exports (eg. module.exports), like normal require()
loadCakefile.require('./Cakefile')
# { watchFiles: [Function],
#   buildLib: [Function],
#   buildUI: [Function],
# ...

# with no arguments, implicitly loads Cakefile from current working directory
loadCakefile.load()
# { tasks:
#    { 'build:lib':
#       { name: 'build:lib',
# ...

Installation

npm install load-cakefile

Current Tags

  • 0.0.3                                ...           latest (6 years ago)

3 Versions

  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |