Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A javascript implementation of the ckmeans algorithm. It's effectively a 1-dimensional version of kmeans, where a set of values are clustered into discrete groups. The algorithm has an O(kn log(n))
runtime.
There is also a native version of this package if you need faster performance in node environments, see ckmeans-native
For an alternative API used commonly in data visualization applications, check out d3-scale-cluster.
Install the npm package
npm install --save ckmeans
Load into your project
// Using ES6 imports
import ckmeans from 'ckmeans';
// Or, using require
var ckmeans = require('ckmeans');
You can also use something like unpkg.com to include it via <script>
tag in the browser.
This function returns the first value in each cluster
var result = ckmeans([1, 2, 4, 5, 12, 43, 52, 123, 234, 1244], 6);
// [1, 12, 43, 123, 234, 1244]
Thanks to Haizhou Wang and Mingzhou Song for developing the original Ckmeans 1D clustering algorithm
yarn
yarn test # run tests
yarn build # build distributable files
yarn build
npm version [major|minor|patch]
git push origin --tags
npm publish
FAQs
Ckmeans Javascript Implementation - Fast Univariate Clustering
We found that ckmeans 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.