Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

diesel

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diesel

Dumb Interpretively Executed String Expression Language

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by233.33%
Maintainers
0
Weekly downloads
 
Created
Source

DIESEL JS

What is DIESEL ?

Diesel is widely used in AutoCAD

This Dumb Interpretively Executed String Expression Language is the kernel of a macro language you can customize by adding C code and embedding it into your program.

It is short, written in portable C, and is readily integrated into any program. It is useful primarily for programs that need a very rudimentary macro expansion facility without the complexity of a full language such as Lisp or FORTH.

Try it online: https://dderevjanik.github.io/diesel-js/

Our DIESEL documentation with Examples: ./docs/DIESEL.md

Fourmilab DIESEL Documentation

What is DIESEL JS ?

Diesel JS is a JavaScript compilation of the DIESEL language using Emscripten. It is a simple and easy-to-use library that allows you to evaluate DIESEL expressions in JavaScript.

Diesel JS is compiled with

Usage

Install package npm i diesel

Browser

Node

import { evaluate } from "diesel";

const result = await evaluate("$(+, 1, 2)");
console.log(result); // 3

CLI

npx diesel '$(+, 1, 2)'

or by installing diesel-cli globally npm i -g diesel and then using diesel '$(+, 1, 2)'

Try it online

https://dderevjanik.github.io/diesel-js/

Examples

Checkout Diesel Examples

Differences with AutoCAD DIESEL

AutoCAD extends DIESEL with additional functions and variables. This library does not support all of them, but it does support the most common ones. Functions like rtos and angtos are not supported in DIESEL JS.

Development

(Optional) Compiling DIESEL into WASM

In order to compile DIESEL into javascript, you need to have Docker installed (emscripten is used to compile the C code into WebAssembly).

npm run compile-diesel

Running the project

  • npm i install dependencies
  • npm test to run unit tests (based on Fourmilab DIESEL tests)
  • ts-node ./src/cli.ts -h to run the CLI

TODO

  • Add AutoCAD functions (rtos, angtos, etc.)
  • Publish to NPM

Keywords

FAQs

Package last updated on 22 Aug 2024

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