Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cos-similarity

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cos-similarity - npm Package Compare versions

Comparing version 1.0.0-rc.1 to 1.0.0

39

package.json
{
"name": "cos-similarity",
"version": "1.0.0-rc.1",
"version": "1.0.0",
"description": "Computes the cosine similarity between two vectors",

@@ -33,21 +33,24 @@ "keywords": [

"build": "rollup -i index.js -o dist/index.js -f cjs",
"lint": "eslint '*.js'",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"lint": "eslint .",
"prepare": "npm run build",
"test": "nyc --reporter html tape -r esm index.test.js | faucet && nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100"
"test": "nyc --reporter html tape -r esm index.test.js | faucet && nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100",
"posttest": "npm run lint"
},
"devDependencies": {
"benchmark": "^2.1.4",
"compute-cosine-similarity": "^1.0.0",
"cosine-similarity": "^1.0.1",
"benchmark": "2.1.4",
"compute-cosine-similarity": "1.0.0",
"cosine-similarity": "1.0.1",
"coveralls": "3.0.3",
"doc-similarity": "0.0.1",
"eslint": "^5.13.0",
"eslint-config-pretty-strict": "^1.0.0-rc.16",
"eslint-plugin-prettier": "^3.0.1",
"esm": "^3.2.4",
"eslint": "5.16.0",
"eslint-config-pretty-strict": "2.0.0",
"eslint-plugin-prettier": "3.0.1",
"esm": "3.2.22",
"faucet": "0.0.1",
"husky": "^1.3.1",
"nyc": "^13.2.0",
"prettier": "1.16.4",
"rollup": "^1.1.2",
"tape": "^4.9.2"
"husky": "2.1.0",
"nyc": "14.0.0",
"prettier": "1.17.0",
"rollup": "1.10.1",
"tape": "4.10.1"
},

@@ -68,13 +71,13 @@ "eslintConfig": {

"eslintIgnore": [
"coverage",
"dist"
],
"esm": {
"cjs": true,
"mode": "auto"
"sourceMap": true
},
"husky": {
"hooks": {
"pre-commit": "npm test && npm run lint"
"pre-commit": "npm test"
}
}
}

@@ -5,8 +5,9 @@ # cos-similarity

[![Build Status](https://travis-ci.com/rtomrud/cos-similarity.svg?branch=master)](https://travis-ci.com/rtomrud/cos-similarity)
[![Coverage Status](https://coveralls.io/repos/github/rtomrud/cos-similarity/badge.svg?branch=master)](https://coveralls.io/github/rtomrud/cos-similarity?branch=master)
[![Code size](https://badgen.net/bundlephobia/minzip/cos-similarity)](https://bundlephobia.com/result?p=cos-similarity)
Computes the [cosine similarity](https://en.wikipedia.org/wiki/Cosine_similarity) between two vectors
- Optimized for dense vectors, that is, arrays
- Works with different length vectors, ignoring the additional dimensions of the longest one
- Works with zero vectors, returning `0` if any vector is `0`, `undefined` or `[]`
- Accepts vectors with different lengths, ignoring the additional dimensions of the longest one
- Accepts zero vectors, returning `0` if any vector is `0`, `undefined` or `[]`

@@ -13,0 +14,0 @@ ## Installing

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc