
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
sf-formula
Advanced tools
A powerful formula evaluation engine for TypeScript/JavaScript applications.
npm install sf-formula
This library provides multiple import paths to avoid dependency conflicts, especially with CodeMirror:
import { formulaEval } from 'sf-formula';
// For projects that want to avoid CodeMirror dependencies
import { formulaEval } from 'sf-formula/core';
// Direct access to TypeScript source files
import { formulaEval } from 'sf-formula/src';
// Import specific functionality
import { defaultFunctions } from 'sf-formula/functions';
import { parser } from 'sf-formula/parser';
If you're using CodeMirror in your project and experiencing conflicts, use the /core
import:
import { formulaEval } from 'sf-formula/core';
import { EditorView } from '@codemirror/view'; // Your own CodeMirror version
// This avoids duplicate CodeMirror instances
const result = formulaEval('2 + 2');
For CodeMirror language support (syntax highlighting, autocompletion), install peer dependencies:
npm install @codemirror/language @codemirror/autocomplete @lezer/common @lezer/highlight @lezer/lr
Then use:
import { languagePack } from 'sf-formula';
import { EditorView } from '@codemirror/view';
const view = new EditorView({
extensions: [languagePack()],
// ... other config
});
import { formulaEval } from 'sf-formula/core';
// Simple evaluation
const result = formulaEval('2 + 2'); // 4
// With variables
const context = { x: 10, y: 5 };
const result2 = formulaEval('x + y', context); // 15
// With nested objects
const context2 = { user: { age: 25 } };
const result3 = formulaEval('user.age > 18', context2); // true
// With functions
const result4 = formulaEval('IF(x > 0, "positive", "negative")', { x: 5 }); // "positive"
If you need CodeMirror integration, install these peer dependencies:
@codemirror/language
@codemirror/autocomplete
@lezer/common
@lezer/highlight
@lezer/lr
MIT
FAQs
Formula evaluation engine
The npm package sf-formula receives a total of 2 weekly downloads. As such, sf-formula popularity was classified as not popular.
We found that sf-formula demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.