Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
A vector and numeric array implementation with common math and statistical functions for JavaScript and TypeScript
ts-vector provides a Vector class that extends the JavaScript/TypeScript array with the most commonly used mathematical and statistical functions.
This library uses EcmaScript 6 array inheritance, so it's not going to work in old browsers!
Node.js 5.0 and the latest Chrome already support most of the Array inheritance features.
Install it from NPM:
npm install ts-vector
, or use a bundled .js file:
ts-vector.js
Check the API Reference
var v = new Vector(100).fillBy(() => Math.random());
var {x,y,dx} = v.histogram({ bins: 10 });
var mode = x[y.argmax()];
console.log('Most values between:', mode, mode + dx);
var y_cum = y.cumsum();
console.log('Cumulative distribution:', x, y_cum);
var lessCount = v.lessThan(0.5).sum();
console.log('Smaller than 0.5:', lessCount/v.length);
// vector operations:
var v = Vector.from([0, 3, 2, 12, 3]);
var size = v.magnitude();
var result = v.add(1).subtract([1, 3, -2, 2, 7]).dot([5, 0, 1, -3, 4]);
MIT License
FAQs
A vector and numeric array implementation with common math and statistical functions for JavaScript and TypeScript
The npm package ts-vector receives a total of 2 weekly downloads. As such, ts-vector popularity was classified as not popular.
We found that ts-vector 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
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.