
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@fileverse-dev/formulajs
Advanced tools
JavaScript implementation of most Microsoft Excel formula functions
Official website and documentation is here
Powered by jsDelivr, you can use the latest version of Formula.js:
<script src="https://cdn.jsdelivr.net/npm/@formulajs/formulajs/lib/browser/formula.min.js"></script>
Then the functions can be accessed as
formulajs.DATE(2008, 7, 8)
formulajs.SUM([1, 2, 3])
...
Install the package:
npm i @formulajs/formulajs
import * as formulajs from '@formulajs/formulajs' // import entire package
formulajs.SUM([1, 2, 3]) // 6
import { SUM } from '@formulajs/formulajs' // import individual components
SUM([1, 2, 3]) // 6
const formulajs = require('@formulajs/formulajs') // require entire package
formulajs.SUM([1, 2, 3]) // 6
const { SUM } = require('@formulajs/formulajs') // require individual components
SUM([1, 2, 3]) // 6
When Formula.js is installed globally using npm, it can be used from the command line. To install Formula.js globally:
npm i -g @formulajs/formulajs
After installation, Formula.js is available via the command line:
$ formulajs
> SUM(1,2,3)
6
The functions DATE, DATEVALUE, EDATE, EOMONT, NOW, TODAY
return plain JS Date instead of the serial Excel number.
Copying composite formula directly from Excel into JS will not work out of the box:
= DATE(2020,5,9) - DATE(2020,5,8) // Formula.js: 86400000 / Excel: 1
It is not recommended to use DATEVALUE
to parse string representing a date. Formula.js uses new Date('YOUR STRING')
under the hood. There are better libraries to do this job (for example Moment.js)
If you were previously using formulajs from Sutoiku, some functions have been removed, due to dependency simplification.
Text functions:
FIXED, TEXT, DOLLAR, VALUE
Math functions:
MDETERM, MINVERSE, MMULT, MUNIT
Otherwise, the 2 packages are fully compatible. You can swap them.
The code of this package is originally forked from @handsontable/formulajs version 2.0.2 (released in January 2020). The two packages were identical at the time. There is no regression, only fixes and new functions since the fork.
Original Formula.js project was developed and maintained by Ismael Chang Ghalimi, with support from Sutoiku and help from the following contributors: Ilmari Karonen, Sébastien Loisel, Trevor Norris, Roönaän, Hannes Stiebitzhofer.
It was then forked and extended by the handsontable/formula.js mainly contributed by @budnix.
As of September 2023, the repo is officially detached from its Handsontable and Sutoiku origins.
FAQs
JavaScript implementation of most Microsoft Excel formula functions
The npm package @fileverse-dev/formulajs receives a total of 653 weekly downloads. As such, @fileverse-dev/formulajs popularity was classified as not popular.
We found that @fileverse-dev/formulajs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.