New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

formula

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formula

Formula runtime for JavaScript.

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
404
decreased by-31.06%
Maintainers
2
Weekly downloads
 
Created
Source

formula

circleci

Formula language for Node.js and Browser. See docs for language syntax.

Install

npm install --save formula

Usage

  1. Require the compiler.

    var compiler = require('formula');

Then you need a data object and a context that supports a get function.

var data = { successText: "Works!", errorText: "Broken!" };
var context = { get: function(key) { return data[key]; } };

Use the compiler to generate a function.

var myFunction = compiler.compile('if(true, successText, errorText)');

Run the function passing back in the requirements by calling resolve().

var result = myFunction(context, myFunction.resolve())

Properties

The function includes properties:

The identifier:

myFunction.id

The abstract syntax tree:

myFunction.ast

The list of required functions:

myFunction.requires

The list of precedents:

myFunction.precedents

dist

The scripts in dist are package for the browser with browserify. They use the namespace of formula.

Keywords

FAQs

Package last updated on 26 Oct 2016

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