{"_id":"@alonfixlerfiverr/cld3-asm","_rev":"1-ae5110e864725db5c8d086f4e5b797a2","name":"@alonfixlerfiverr/cld3-asm","dist-tags":{"latest":"3.1.4"},"versions":{"3.1.2":{"name":"@alonfixlerfiverr/cld3-asm","version":"3.1.2","description":"WebAssembly based Javascript bindings for google compact language detector 3","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/types/index.d.ts","browser":{"./dist/cjs/lib/node/cld3.js":"./dist/cjs/lib/browser/cld3.js","./dist/esm/lib/node/cld3.js":"./dist/esm/lib/browser/cld3.js"},"engines":{"node":">=10"},"config":{"commitizen":{"path":"cz-conventional-changelog"},"cld3-version":"v1.0.17"},"lint-staged":{"*.{ts,js}":["prettier --write --single-quote --print-width 120 --jsx-bracket-same-line true --ignore-path ./src/lib/*.js","tslint --fix","git add"]},"scripts":{"prepare":"ts-node bootstrap.ts","test:cld":"jest --config jest-cld.json","test:cld-asm":"jest --config jest-cld-asm.json --coverage","test":"npm-run-all test:*","lint":"tslint -c tslint.json -p tsconfig.json \"src/**/*.ts\" \"spec/**/*.ts\"","lint:staged":"lint-staged","build":"tsc -b --verbose ./src/tsconfig.cjs.json ./src/tsconfig.esm.json ./src/tsconfig.types.json ./spec/tsconfig.json","build:clean":"shx rm -rf ./dist","build:lib":"shx cp -r ./src/lib ./dist/cjs && shx cp -r ./src/lib ./dist/esm","commit":"git-cz -S","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s"},"repository":{"type":"git","url":"git+https://github.com/kwonoj/cld3-asm.git"},"keywords":["WebAssembly","Wasm","cld","Language"],"author":{"name":"OJ Kwon","email":"kwon.ohjoong@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwonoj/cld3-asm/issues"},"homepage":"https://github.com/kwonoj/cld3-asm#readme","devDependencies":{"@commitlint/cli":"^8.1.0","@commitlint/config-angular":"^8.1.0","@types/chai":"^4.1.7","@types/jest":"^24.0.15","@types/lodash":"^4.14.136","@types/node":"^12.6.8","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","chai":"^4.2.0","commitizen":"^4.0.2","conventional-changelog-cli":"^2.0.21","cz-conventional-changelog":"2.1.0","husky":"^3.0.1","jest":"^24.8.0","jest-spin-reporter":"^1.0.2","lint-staged":"^9.2.0","lodash":"^4.17.15","npm-run-all":"^4.1.5","prettier":"^1.18.2","shelljs":"^0.8.3","shx":"^0.3.2","ts-jest":"^24.0.2","ts-node":"^8.3.0","tslint":"^5.18.0","tslint-no-unused-expression-chai":"^0.1.4","typescript":"^3.5.3","utf8":"^3.0.0"},"dependencies":{"emscripten-wasm-loader":"^3.0.3"},"husky":{"hooks":{"commit-msg":"commitlint -e","pre-commit":"lint-staged","pre-push":"npm run prepublishOnly"}},"gitHead":"e19863af897cdf860c3aea86f29708cf907a1402","_id":"@alonfixlerfiverr/cld3-asm@3.1.2","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","_npmUser":{"name":"alonfixlerfiverr","email":"alon.fixler@fiverr.com"},"dist":{"integrity":"sha512-FJCkTav+2frB175RW5FsXoF5RAPGbfgYCwn2UNTOunNwsvjfqbT85KOCh58j8VVhRWXHDdMf3oMv8A8fV4C1hA==","shasum":"aab110a51236ec2eea155ad1bd12a841aeeed236","tarball":"https://registry.npmjs.org/@alonfixlerfiverr/cld3-asm/-/cld3-asm-3.1.2.tgz","fileCount":79,"unpackedSize":6529941,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4c/suUquIq2NW/10bpi+vsxinZGhVzhMQVkltVj+JuAIhAODmFs317v+u1zdXnjFjOqTjICBl7tqxBWuA/7u1E83P"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPDqMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq8NQ//Qop7sCsGTgN+pQ3vwSPOZx94r+U53wQDvc7Mhal6W4q6vRvd\r\n/NeM1mk6pz0O0fT50mBloW+qoeSc6a/MwCw3YANv3K8M6fHqP19qkgMPDoCy\r\naqobpJ9D0wmInFg4hj4UiPcOcT164Htz8RllXLE7DKJqJ+COTYenPTU5on6J\r\nQldayyeeJkfSopWQ+nCz5sKkUOhp/+lGkRLZrYm3IfKD5sex7DacG4tBKTz0\r\nQBTJ1NTVgixOGT6TmCnHoZkZ7Z2JXRLKPf43vYJfw7c1nINWqmgVXNwybPPj\r\n73v4Ue6gCakZk0Uu64LTH73DCAdFgQWTAAFcLzUEr4NPy7pl31mXZZgfIxAZ\r\n11NN7x4Dn7evYPHmry1DUQWhAySGyd7FIKPUZnApobgS5N2G5w1KaagK4DRM\r\n5Jf77YE3IM+Rzr1hVM5MgfNVsUyHQFNrvrH9+8TeeEOrK1DlU5rsoT8ETnXb\r\n9z1AGhOkdl7mAWeBciS6P2ku7/T8CTtzUoxrIp2QoqeHbxn2VX5B+oiisXkO\r\nCN3pKdQ282nGqtJ6xjXmHNPf1Sp2TWaodxemu3OHVYIsBv8HgtcMSaNSMKJw\r\n9Ssr214QOTpwOO6eC2cesa5jfrmYShS13hQABXrUHTFcudXhYXsxG6skEAlm\r\nkICFPOtornwlu5rfffhRKuSpImcyN0VpTvE=\r\n=AqV8\r\n-----END PGP SIGNATURE-----\r\n"},"directories":{},"maintainers":[{"name":"alonfixlerfiverr","email":"alon.fixler@fiverr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cld3-asm_3.1.2_1681668748018_0.03852110482423288"},"_hasShrinkwrap":false},"3.1.4":{"name":"@alonfixlerfiverr/cld3-asm","version":"3.1.4","description":"WebAssembly based Javascript bindings for google compact language detector 3","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/types/index.d.ts","browser":{"./dist/cjs/lib/node/cld3.js":"./dist/cjs/lib/browser/cld3.js","./dist/esm/lib/node/cld3.js":"./dist/esm/lib/browser/cld3.js"},"engines":{"node":">=10"},"config":{"commitizen":{"path":"cz-conventional-changelog"},"cld3-version":"v1.0.28"},"lint-staged":{"*.{ts,js}":["prettier --write --single-quote --print-width 120 --jsx-bracket-same-line true --ignore-path ./src/lib/*.js","tslint --fix","git add"]},"scripts":{"prepublishOnly":"npm-run-all build:clean build build:lib test","prepare":"ts-node bootstrap.ts","test:cld":"jest --config jest-cld.json","test:cld-asm":"jest --config jest-cld-asm.json --coverage","test":"npm-run-all test:*","lint":"tslint -c tslint.json -p tsconfig.json \"src/**/*.ts\" \"spec/**/*.ts\"","lint:staged":"lint-staged","build":"tsc -b --verbose ./src/tsconfig.cjs.json ./src/tsconfig.esm.json ./src/tsconfig.types.json ./spec/tsconfig.json","build:clean":"shx rm -rf ./dist","build:lib":"shx cp -r ./src/lib ./dist/cjs && shx cp -r ./src/lib ./dist/esm","commit":"git-cz -S","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s"},"repository":{"type":"git","url":"git+https://github.com/kwonoj/cld3-asm.git"},"keywords":["WebAssembly","Wasm","cld","Language"],"author":{"name":"OJ Kwon","email":"kwon.ohjoong@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/kwonoj/cld3-asm/issues"},"homepage":"https://github.com/kwonoj/cld3-asm#readme","devDependencies":{"@commitlint/cli":"^8.1.0","@commitlint/config-angular":"^8.1.0","@types/chai":"^4.1.7","@types/jest":"^24.0.15","@types/lodash":"^4.14.136","@types/node":"^12.6.8","@types/shelljs":"^0.8.5","@types/utf8":"^2.1.6","chai":"^4.2.0","commitizen":"^4.0.2","conventional-changelog-cli":"^2.0.21","cz-conventional-changelog":"2.1.0","husky":"^3.0.1","jest":"^24.8.0","jest-spin-reporter":"^1.0.2","lint-staged":"^9.2.0","lodash":"^4.17.15","npm-run-all":"^4.1.5","prettier":"^1.18.2","shelljs":"^0.8.3","shx":"^0.3.2","ts-jest":"^24.0.2","ts-node":"^8.3.0","tslint":"^5.18.0","tslint-no-unused-expression-chai":"^0.1.4","typescript":"^3.5.3","utf8":"^3.0.0"},"dependencies":{"emscripten-wasm-loader":"^3.0.3"},"husky":{"hooks":{"commit-msg":"commitlint -e","pre-commit":"lint-staged","pre-push":"npm run prepublishOnly"}},"gitHead":"298493c2daa96084915b7476805d2d764c9d4527","_id":"@alonfixlerfiverr/cld3-asm@3.1.4","_nodeVersion":"10.24.1","_npmVersion":"6.14.12","_npmUser":{"name":"alonfixlerfiverr","email":"alon.fixler@fiverr.com"},"dist":{"integrity":"sha512-MB39A5KhpIYvtirb4V+qL8pnWy3DUiCkT1dtXJ8xRBbDr7AltAczIEO2bi+zjBds1XCtM1Ngtfr2Uueyd+aThg==","shasum":"fddbc4e795182100f81690f196aa14beb2ffcb23","tarball":"https://registry.npmjs.org/@alonfixlerfiverr/cld3-asm/-/cld3-asm-3.1.4.tgz","fileCount":79,"unpackedSize":6601852,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRMUb4vGnIDC/3F3oWjJMeR5EoKdCKw1SWz1YbONSuMQIgE9ji2p39Y/F/lOfavQTe3SRv1JXolCKtWo/f0ctuo+U="}]},"directories":{},"maintainers":[{"name":"alonfixlerfiverr","email":"alon.fixler@fiverr.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/cld3-asm_3.1.4_1691566792394_0.4102186594648187"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-16T18:12:27.949Z","3.1.2":"2023-04-16T18:12:28.296Z","modified":"2023-08-09T07:39:52.848Z","3.1.4":"2023-08-09T07:39:52.675Z"},"maintainers":[{"name":"alonfixlerfiverr","email":"alon.fixler@fiverr.com"}],"description":"WebAssembly based Javascript bindings for google compact language detector 3","homepage":"https://github.com/kwonoj/cld3-asm#readme","keywords":["WebAssembly","Wasm","cld","Language"],"repository":{"type":"git","url":"git+https://github.com/kwonoj/cld3-asm.git"},"author":{"name":"OJ Kwon","email":"kwon.ohjoong@gmail.com"},"bugs":{"url":"https://github.com/kwonoj/cld3-asm/issues"},"license":"MIT","readme":"[![Build Status](https://travis-ci.org/kwonoj/cld3-asm.svg?branch=master)](https://travis-ci.org/kwonoj/cld3-asm)\n[![Build status](https://ci.appveyor.com/api/projects/status/vko7m5l7brt5w9ok?svg=true)](https://ci.appveyor.com/project/kwonoj/cld3-asm)\n[![codecov](https://codecov.io/gh/kwonoj/cld3-asm/branch/master/graph/badge.svg)](https://codecov.io/gh/kwonoj/cld3-asm)\n[![npm](https://img.shields.io/npm/v/cld3-asm.svg)](https://www.npmjs.com/package/cld3-asm)\n[![node](https://img.shields.io/badge/node-=>8.0-blue.svg?style=flat)](https://www.npmjs.com/package/cld3-asm)\n\n# cld3-asm\n\n`cld3-asm` is isomorphic javascript binding to google's [compact language detector v3](https://github.com/google/cld3) based on WebAssembly cld3 binary. This module aims to provide thin, lightweight interface to cld3 without requiring native modules.\n\n# Install\n\n```sh\nnpm install cld3-asm\n```\n\n# Usage\n\n## Loading module asynchronously\n\n`cld3-asm` relies on wasm binary of cld3, which need to be initialized first.\n\n```js\nimport { loadModule } from 'cld3-asm';\n\nconst cldFactory = await loadModule();\n```\n\n`loadModule` loads wasm binary, initialize it, and returns factory function to create instance of cld3 [language identifier.](https://github.com/kwonoj/cld3-asm/blob/1a86bb67abcebc2cd0e90a83149292eb044e4122/src/cldAsmModule.ts#L70-L97)\n\n```js\nloadModule({ timeout?: number }): Promise<CldFactory>\n```\n\nIt allows to specify timeout to wait until wasm binary compliation & load.\n\n## Creating language identifier\n\n```js\ncreate(minBytes?: number, maxBytes?: number): LanguageIdentifier\n```\n\n`LanguageIdentifier` exposes minimal interfaces to cld3's `NNetLanguageIdentifier`.\n\n- `findLanguage(text: string): Readonly<LanguageResult>` : Finds the most likely language for the given text.\n- `findMostFrequentLanguages(text: string, numLangs: number): Array<Readonly<LanguageResult>>` : Splits the input text into spans based on the script, predicts a language for each span, and returns a vector storing the top num_langs most frequent languages\n- `dispose(): void` : Destroy current instance of language identifier. It is important to note created instance will not be destroyed automatically.\n\nThere are simple [examples](https://github.com/kwonoj/cld3-asm/tree/master/examples) for each environments. In each example directory do `npm install && npm start`.\n\n# Building / Testing\n\nFew npm scripts are supported for build / test code.\n\n- `build`: Transpiles code to ES5 commonjs to `dist`.\n- `test`: Run `cld` / `cld3-asm` test both. Does not require `build` before execute test.\n- `test:cld`: Run integration test for actual cld3 wasm binary, using [cld's test case](https://github.com/google/cld3/blob/2afbfc6f8b82cb7a5557c81862509e06f4f23ac4/src/nnet_lang_id_test.cc).\n- `test:cld3-asm`: Run unit test against `cld3-asm` interface\n- `lint`: Run lint over all codebases\n- `lint:staged`: Run lint only for staged changes. This'll be executed automatically with precommit hook.\n- `commit`: Commit wizard to write commit message\n\n# License\n\n- cld3: [original license](https://github.com/google/cld3/blob/master/LICENSE)\n- cld3-asm: [MIT](https://github.com/kwonoj/cld3-asm/blob/master/LICENSE)","readmeFilename":"README.md"}