JavaScript / WebAssembly
SCS is available in a WebAssembly version that can be used with JavaScript. Note that the JavaScript version does not support compiling with BLAS and LAPACK, so it does not support solving SDPs.
For building the WebAssembly version from source, see the scs.wasm repository.
The page on the JS interface provides more information on how to use SCS in JavaScript environments once loaded or installed.
Install with npm
The package can be installed using npm:
npm install scs-solver
It can be used in Node.js and in the browser.
Loading from a CDN in the browser
The package can also directly be included in a webpage using a CDN, by using one of the following script tags:
<script src="https://unpkg.com/scs-solver/dist/scs.js"></script>
<script src="https://cdn.jsdelivr.net/npm/scs-solver/dist/scs.js"></script>
It can also be imported in JavaScript code using ES6 modules:
<script type="module">
import createSCS from 'https://unpkg.com/scs-solver/dist/scs.mjs';
// ...
</script>
You can also host the files yourself, by downloading the files, and putting scs.js
(or
scs.mjs
) and scs.wasm
in the same directory.