https://github.com/jsdf/load-cakefile
load or require the logical contents of CoffeeScript Cakefiles
https://github.com/jsdf/load-cakefile
Last synced: about 2 months ago
JSON representation
load or require the logical contents of CoffeeScript Cakefiles
- Host: GitHub
- URL: https://github.com/jsdf/load-cakefile
- Owner: jsdf
- License: mit
- Created: 2014-06-17T03:08:32.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-06-17T06:09:29.000Z (almost 11 years ago)
- Last Synced: 2025-03-06T06:40:49.795Z (about 2 months ago)
- Language: CoffeeScript
- Homepage:
- Size: 125 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# load-cakefile
loads/requires tasks and exports from a Cakefile (because normal require() doesn't work with Cakefiles)
### Example
```coffee
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
```bash
npm install load-cakefile
```