to-tsvector
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

to-tsvector

It is the js implementation of to_tsvector of postgres

How to use

import toTsvector from 'to-tsvector';

toTsvector('I can do this all day');
// 'i':1 'can':2 'do':3 'this':4 'all':5 'day':6

toTsvector('I can do this all day, all day')
// 'i':1 'can':2 'do':3 'this':4 'all':5,7 'day':6,8

toTsvector('I can do this all day', { weight: 'A' });
// 'i':1A 'can':2A 'do':3A 'this':4A 'all':5A 'day':6A

toTsvector(['to_tsvector', 'postgres', 'js', 'implementation']);
// 'to_tsvector':1 'postgres':2 'js':3 'implementation':4

toTsvector('测试 中文 输出效果', { weight: 'A' });
// '测试':1A '中文':2A '输出效果':3A

toTsvector(['你好', '世界']);
// '你好':1 '世界':2

/to-tsvector/

    Package Sidebar

    Install

    npm i to-tsvector

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    17.9 kB

    Total Files

    12

    Last publish

    Collaborators

    • libeilong