agglomerative-clustering
Version:
Fast hierarchical agglomerative clustering powered by WebAssembly.
69 lines (68 loc) • 2.4 kB
JSON
{
"name": "agglomerative-clustering",
"version": "1.1.4",
"description": "Fast hierarchical agglomerative clustering powered by WebAssembly.",
"license": "MIT",
"author": "Rohan Fredriksson",
"type": "module",
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/RohanFredriksson/agglomerative-clustering.git"
},
"keywords": [
"nodejs",
"browser",
"cpp",
"clustering",
"kd-tree",
"webassembly",
"wasm",
"image-processing",
"nearest-neighbour",
"image-compression",
"image-analysis",
"palette-generation",
"hierarchical-clustering",
"color-clustering",
"agglomerative-clustering",
"image-quantization",
"color-reduction",
"spatial-hashing"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
}
},
"files": [
"dist/",
"README.md"
],
"scripts": {
"build:wasm": "mkdirp dist && emcc src/clustering.cpp -O3 -s WASM=1 -s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME='createWasmModule' -s ALLOW_MEMORY_GROWTH=1 -s INITIAL_MEMORY=32MB -s MAXIMUM_MEMORY=2147483648 -s EXPORTED_FUNCTIONS=\"['_get_clustering','_get_palette','_get_palette_from_clustering','_quantize','_quantize_with_clustering','_quantize_with_palette','_malloc','_free']\" -s EXPORTED_RUNTIME_METHODS=\"['HEAPU8']\" -o dist/clustering.js",
"build:cjs": "cross-env BABEL_ENV=cjs babel src --out-dir dist --extensions \".js\" --out-file-extension .cjs",
"build:esm": "cross-env BABEL_ENV=esm babel src --out-dir dist --extensions \".js\" --out-file-extension .mjs",
"build:types": "mkdirp dist && node -e \"require('fs').copyFileSync('src/index.d.ts', 'dist/index.d.ts')\"",
"build:js": "npm run build:types && npm run build:cjs && npm run build:esm",
"build": "npm run build:wasm && npm run build:js",
"prepublishOnly": "npm run build",
"test": "vitest run",
"bench": "vitest bench",
"quality": "node bench/quality.js"
},
"devDependencies": {
"@babel/cli": "^7.27.2",
"@babel/core": "^7.27.4",
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
"@babel/preset-env": "^7.27.2",
"canvas": "^3.2.3",
"cross-env": "^7.0.3",
"image-q": "^4.0.0",
"mkdirp": "^3.0.1",
"vitest": "^4.1.5"
}
}