You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

nanolisp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanolisp

Embeddable Lisp for JS projects

1.1.0
latest
npmnpm
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Nanolisp

nanolisp is a small, extensible lisp to embed in JavaScript applications.

Installation and usage

npm install nanolisp

const lisp = require('nanolisp')();

lisp.run(`
(def foobar (add 1 2))
(echo foobar)
`);

Embedding custom libraries

To make this useful, you'll typically want to include libraries that are connected to your application context.

const nanolisp = require('nanolisp');

const appContext = {
    health: 400
};

const library = {
    takeDamage: (hit) => {
        appContext.health -= hit;
    },
    life: () => appContext.health
};

const lisp = nanolisp(library);

const result = lisp.run(`
    (echo life)
    (takeDamage 100)
    (echo life)
`);

Inspiration

This lisp is a fork from what was built for Ronin.

Keywords

lisp

FAQs

Package last updated on 02 Oct 2019

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