node package manager

yak-lang

Yak

Yak is the first language of the funject paradigm. If you don't know about it, read about it. The yak-lang module gives you a full Yak interpreter.

Installing

$ npm install yak-lang

Usage

var yak = require('yak-lang');

You can evaluate strings of Yak:

yak.eval('print["Hello, Yak!"]');

Or evaluate entire files:

yak.evalFile('./awesomeness.yak', function (err, result) {
...
});

Both eval and evalFile pass their callbacks any errors and a JavaScript object representing the last Yak expression.

You can also use their synchronous cousins evalSync and evalFileSync:

yak.evalFileSync('./app.yak');

Import

In Yak you can access the require-like funject import:

import['./another.yak']

In another.yak you have access to the require-esque exports:

exports.foo = 'bar'

exports[Math.sin[@x]] := Math.cos[@x]