language
DSLs for the washed masses
Last updated 7 years ago by refractalize .
BSD-2-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install language 
SYNC missed versions from official npm registry.

Language

language is a very small library for building DSLs in Javascript.

npm install language

Why?

Because magic scope! and because no globals!

var language = require('language');

var robot = language({
  position: {x: 0, y: 0},

  moveLeft: function() {
    this.position.x--;
  },

  moveRight: function() {
    this.position.x++;
  },

  moveUp: function() {
    this.position.y--;
  },

  moveDown: function() {
    this.position.y++;
  },
});

robot(function () {
  console.log(position);

  moveDown();
  console.log(position);

  moveRight();
  console.log(position);
});

How?

Read the source, it's small.

Current Tags

  • 0.4.0                                ...           latest (7 years ago)

6 Versions

  • 0.4.0                                ...           7 years ago
  • 0.3.0                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 1
This Week 2
This Month 4
Last Day 0
Last Week 1
Last Month 5
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |