
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.
NLopt-js is a port of [NLopt](https://nlopt.readthedocs.io/en/latest/) C++ optimization library
NLopt-js is a port of the nlopt C++ optimization library
It uses a WebAssembly compiled subset of the nlopt library, and implements a garbage collection mechanism to manage memory
NLopt-js can be installed via npm or yarn
npm install nlopt-js
yarn add nlopt-js
In a node application or in the browser (using webpack)
const nlopt = require('nlopt-js')
// ES6: import nlopt from 'nlopt-js'
(async () => {
await nlopt.ready
const opt = new nlopt.Optimize(nlopt.Algorithm.LD_SLSQP, 2);
opt.setMinObjective((x, grad) => {
if (grad) {
grad[0] = 0;
grad[1] = 0.5 / Math.sqrt(x[1]);
}
return Math.sqrt(x[1]);
}, 1e-4);
const res = opt.optimize([1, 6]);
// Flush the GC
nlopt.GC.flush();
})();
The documentation is available at NLopt-js
Make sure Emscripten is intalled & activated in your terminal session
source path/to/emsdk/emsdk_env.sh
./emcc -v
Dowload the latest version of the nlopt library and extract it under
lib/nlopt
Now build a bytecode shared library
mkdir build; cd build
emcmake cmake ..
emmake make
It should generate a shared library bytecode file named libnlopt.bc
Now to compile the wasm binary, run the following command
mkdir build
emcc -I lib/nlopt/build -I lib/nlopt/src/api -Isrc lib/nlopt/build/libnlopt.a -s DISABLE_EXCEPTION_CATCHING=0 -s ASSERTIONS=0 -O3 -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 --bind -o build/nlopt_gen.js src/cpp/embind.cc
The documentation is generated from classes descriptions using documentation.js
documentation build src/classes/ -f json -o docs/doc.json
FAQs
NLopt-js is a port of [NLopt](https://nlopt.readthedocs.io/en/latest/) C++ optimization library
The npm package nlopt-js receives a total of 16 weekly downloads. As such, nlopt-js popularity was classified as not popular.
We found that nlopt-js 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.