js-trgm
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

JS_TRGM

Match text using trigrams in Javascript, similar to Postgres' pg_trgm extension.

Installation

npm i js-trgm --save

Usage

import { similarity, trgm_search } from 'js-trgm';

const string1 = 'Hello Word';
const string2 = 'Hello World';
const coll1 = ['Hello World', 'Something else', 'Something else entirely'];

console.log(similarity(string1, string2));
console.log(trgm_search(string1, coll1));

Developing

Once you've created a project and installed dependencies with pnpm install, start a development server:

pnpm dev

# or start the server and open the demo in a new browser tab
pnpm dev -- --open

Packaging

pnpm package

Dependencies (0)

    Dev Dependencies (15)

    Package Sidebar

    Install

    npm i js-trgm

    Weekly Downloads

    0

    Version

    1.0.4

    License

    none

    Unpacked Size

    9.34 kB

    Total Files

    12

    Last publish

    Collaborators

    • gtmnayan