
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
This open source project brings QuantLib to the Node.js community, it's similar to QuantLibXL project which is for Microsoft Excel.
Most functions in QuantLibXL can be used in the similar way in Node on the server side.
All functions in this project are Async, they are exported to Promise sytle function, please see Example below.
npm install quantlib
npm install quantlib will do everything, including the node package installation and pre-built native addon (no dependency) download, you can start use it right away.
v0.2.x windows prebuilt on windows 8.1 with VC14
v0.1.x windows prebuilt on windows 7 with VC12, only 32-bit available
Please refer to how to build below
| QuantLib | QuantLibAddin | Node.js | quantlib.node |
|---|---|---|---|
| 1.7.1 | 1.7.0 | 6.9.1 | 0.1.x |
| 1.8.1 | 1.8.0 | 6.9.5 | 0.2.x |
| 1.9.2 | 1.9.0 | 6.9.5 | 0.3.x |
boost - which is required to build QuantLibfor Mac OS X and Linux, QuantLib projects must be built with
-std=c++11this flag is required by node
for linux, need to add
-fPICflag
please refer to cmake/*.cmake and CMakeList.txt files
NAN_DIR - location of nanNODE_GYP_DIR - location of .node-gyp generated by node-gyp tool, which is at ~/.node-gyp, if it doesn't exist, follow the instruction in node-gyp, and build a helloword program, it will generate the .node-gyp directoryQUANTLIB_ROOT - location of QuantLib, QuantLibAddin, ObjectHandler source codeBOOST_ROOT - location boost installedCMakeList.txt for library name, and make sure generated library names are the same in CMakeList.txtquantlibnode root directory cd buildcmake .. for Windows and Linux, cmake -G Xcode .. for Mac OS Xcmake --build . --config Releasequantlib.node under build/Release manually,This is from QuantLibXL - StandaloneExamples - Math - RankReduction.xlsx - FirstCorrMatrix
C2 - formulat: =qlSymmetricSchurDecomposition(,B3:K12)
M3:12 - forumula: {=qlSymmetricSchurDecompositionEigenvalues(C2)}
the input/output are the same
var ql = require('quantlib');
var mtx1 =
[
[1.00000, 0.97560, 0.95240, 0.93040, 0.90940, 0.88940, 0.87040, 0.85230, 0.83520, 0.81880],
[0.97560, 1.00000, 0.97560, 0.95240, 0.93040, 0.90940, 0.88940, 0.87040, 0.85230, 0.83520],
[0.95240, 0.97560, 1.00000, 0.97560, 0.95240, 0.93040, 0.90940, 0.88940, 0.87040, 0.85230],
[0.93040, 0.95240, 0.97560, 1.00000, 0.97560, 0.95240, 0.93040, 0.90940, 0.88940, 0.87040],
[0.90940, 0.93040, 0.95240, 0.97560, 1.00000, 0.97560, 0.95240, 0.93040, 0.90940, 0.88940],
[0.88940, 0.90940, 0.93040, 0.95240, 0.97560, 1.00000, 0.97560, 0.95240, 0.93040, 0.90940],
[0.87040, 0.88940, 0.90940, 0.93040, 0.95240, 0.97560, 1.00000, 0.97560, 0.95240, 0.93040],
[0.85230, 0.87040, 0.88940, 0.90940, 0.93040, 0.95240, 0.97560, 1.00000, 0.97560, 0.95240],
[0.83520, 0.85230, 0.87040, 0.88940, 0.90940, 0.93040, 0.95240, 0.97560, 1.00000, 0.97560],
[0.81880, 0.83520, 0.85230, 0.87040, 0.88940, 0.90940, 0.93040, 0.95240, 0.97560, 1.00000]
];
/*
* call Constructor to create object, objectID needs to be provided as input, this is diffierent with QuantLibXL
* ObjectID, can be generated with Node.js, it needs to be uniquie
* since this is on server side, you may put session# as part of objectID
*/
ql.SymmetricSchurDecomposition('mtx#1',mtx1).then(function(obj){ //C2 formula: =qlSymmetricSchurDecomposition(,B3:K12)
// call Method with objectID, this is same as QuantLibXL
ql.SymmetricSchurDecompositionEigenvalues(obj).then(function(r){ // M3:12 formula: {=qlSymmetricSchurDecompositionEigenvalues(C2)}
console.log(r);
});
}).catch(function(e){
console.log(e);
});
>
[ 9.270906840163782,
0.4207173234885105,
0.12674770658244172,
0.059239731356788505,
0.03595303870722261,
0.024956978505270924,
0.019117669503864024,
0.01580103250921176,
0.01377474504269164,
0.012784934140218302 ]
FAQs
QuantLib Asyn Bindings for Node.js
We found that quantlib demonstrated a not healthy version release cadence and project activity because the last version was released 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.