Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by250%
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc