šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

language

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

language

DSLs for the washed masses

0.4.0
latest
Source
npm
Version published
Weekly downloads
107
72.58%
Maintainers
1
Weekly downloads
Ā 
Created
Source

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.

Keywords

dsl

FAQs

Package last updated on 05 May 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts