All Projects → sakejs → Sake Core

sakejs / Sake Core

Licence: other
Sake's core interface.

Programming Languages

coffeescript
4710 projects

Projects that are alternatives of or similar to Sake Core

Foy
A simple, light-weight and modern task runner for general purpose.
Stars: ✭ 157 (+101.28%)
Mutual labels:  tasks, build-tool, make, promise
Sake Cli
🍶 Sake is a build tool for JavaScript.
Stars: ✭ 97 (+24.36%)
Mutual labels:  tasks, build-tool, make
up
UP - Ultimate Provisioner CLI
Stars: ✭ 43 (-44.87%)
Mutual labels:  build-tool, make
ProtoPromise
Robust and efficient library for management of asynchronous operations in C#/.Net.
Stars: ✭ 20 (-74.36%)
Mutual labels:  promise, tasks
Ygor
Task toolkit. For when `npm run` isn't enough and everything else is too much.
Stars: ✭ 69 (-11.54%)
Mutual labels:  build-tool, make
Taskorama
⚙ A Task/Future data type for JavaScript
Stars: ✭ 90 (+15.38%)
Mutual labels:  tasks, promise
Svelto.tasks
Svelto Tasks - C# promises compliant multi-threaded tasks runner
Stars: ✭ 159 (+103.85%)
Mutual labels:  tasks, asynchronous-tasks
makesure
Simple task/command runner with declarative goals and dependencies
Stars: ✭ 230 (+194.87%)
Mutual labels:  build-tool, make
Reggae
Build system in D, Python, Ruby, Javascript or Lua
Stars: ✭ 141 (+80.77%)
Mutual labels:  build-tool, make
Mask
🎭 A CLI task runner defined by a simple markdown file
Stars: ✭ 495 (+534.62%)
Mutual labels:  build-tool, make
Start
🔴 Functional task runner for Node.js
Stars: ✭ 478 (+512.82%)
Mutual labels:  tasks, promise
Asynctasks.vim
🚀 Modern Task System for Project Building, Testing and Deploying !!
Stars: ✭ 495 (+534.62%)
Mutual labels:  tasks, make
Cargo Make
Rust task runner and build tool.
Stars: ✭ 895 (+1047.44%)
Mutual labels:  build-tool, make
async
async is a tiny C++ header-only high-performance library for async calls handled by a thread-pool, which is built on top of an unbounded MPMC lock-free queue.
Stars: ✭ 25 (-67.95%)
Mutual labels:  tasks, asynchronous-tasks
Zeus
An Electrifying Build System
Stars: ✭ 176 (+125.64%)
Mutual labels:  build-tool, make
make
The Ultimate Makefile to compile all your C, C++, Assembly and Fortran projects
Stars: ✭ 41 (-47.44%)
Mutual labels:  build-tool, make
Mmake
Mmake is a small program which wraps make to provide additional functionality, such as user-friendly help output, remote includes, and eventually more. It otherwise acts as a pass-through to standard make.
Stars: ✭ 1,593 (+1942.31%)
Mutual labels:  build-tool, make
Arduino Cmake Ng
CMake-Based framework for Arduino platforms
Stars: ✭ 123 (+57.69%)
Mutual labels:  build-tool, make
Task
A task runner / simpler Make alternative written in Go
Stars: ✭ 4,282 (+5389.74%)
Mutual labels:  build-tool, make
Cpprestsdk
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Stars: ✭ 6,631 (+8401.28%)
Mutual labels:  tasks, asynchronous-tasks

Sake

npm build dependencies downloads license chat

It is cold, but · we have Sake · and the hot spring

Sake is a build tool and task runner for JavaScript. Sake features an extensible core and support for modern JS. Inspired by Cake, Sake is the perfect DSL for building projects.

Features

  • Additional helpers to make writing tasks faster and more pleasant.
  • Generator based-control flow in tasks with full support for Promises.
  • Intutive CLI and automatic option parsing.
  • Plugin architecture with available plugins for many common build tasks.
  • Tasks can declare dependencies and be easily composed of and interact with other tasks.
  • Modern JS support:
    • Async/Await
    • ES modules
    • Generators
    • Promises

Install

npm install sake-core --save-dev

Usage

Typically Sake is used via it's command line interface which can be installed with npm install -g sake-cli. Once the sake command is available, you can begin writing a Sakefile and defining available tasks in your project.

Sakefile

Sake will search for a Sakefile with tasks defined for your current project. Sakefiles can be written in ES2015 JavaScript and support modules natively.

Optionally, you can write your Sakefile in CoffeeScript, which allows a very nice DSL-ish experience.

Examples

Async tasks

Async tasks are easy to declare, any task with an obvious callback will be treated as asynchronous. Add an additional argument called callback, cb, done or next and use it to indicate when your task is finished executing.

task 'compile:js', 'compile js', (done) ->
  exec 'coffee -bc app.coffee', done

task 'minify:js',   'minify js', (done) ->
  exec 'uglify-js --compress --mangle app.js > app.min.js', done

Promise tasks

You can also return a promise from your task and sake will automatically wait for it to resolve. Since executive returns a promise, this works too:

task 'compile:js', 'compile js', ->
  exec 'coffee -bc app.coffee'

Invoking multiple tasks

You can manually invoke tasks and string them together with callbacks:

task 'build', 'build project', ->
  invoke 'compile:js', ->
    invoke 'minify:js'

Declaring dependencies

Dependencies can be declared by adding an array of task names after your task's description.

task 'build', 'build project', ['compile:js', 'minify:js']

Serial tasks

You can also pass an array of tasks invoke and it will execute them in order for you:

task 'build', 'build project', (done) ->
  invoke ['compile:js', 'minify:js'], done

...or more explicitly using invoke.serial.

Parallel tasks

If you want to execute tasks in parallel you can use invoke.parallel.

task 'compile', 'compile css & js', (done) ->
  invoke.parallel ['compile:css', 'compile:js'], done

Detecting running tasks

You can check for running tasks using the running helper.

task 'watch', 'watch for changes and re-compile js', ->
  exec 'coffee -bcmw -o lib/ src/'

task 'watch:test', 'watch for changes and re-run tests', (options) ->
  invoke 'watch'

  require('vigil').watch __dirname, (filename, stats) ->
    return if running 'test'

    if /^test/.test filename
      invoke 'test', test: filename
    if /^src/.test filename
      invoke 'test'

Generator tasks

You can also use yield to wait for the value of a promise and eschew the use of callbacks.

task 'compile:js', 'compile js', ->
  yield exec 'coffee -bc app.coffee'

task 'minify:js',   'minify js', ->
  yield exec 'uglify-js --compress --mangle app.js > app.min.js'

This really pays dividends with more complicated tasks:

task 'package', 'Package project', ->
  yield exec '''
    mkdir -p dist
    rm   -rf dist/*
  '''

  yield exec.parallel '''
    cp manifest.json dist
    cp -rf assets    dist
    cp -rf lib       dist
    cp -rf views     dist
  '''

  yield exec '''
    zip -r package.zip dist
    rm -rf dist
  '''

Using Sake with Cake

You can upgrade any Cakefile into a Sakefile by requiring sake-core at the top of your Cakefile.

More

You can peruse Sake's Sakefile for a real world example.

License

BSD-3-Clause

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].