
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
clientside-search
Advanced tools
A highly efficient, isomorphic, full-featured, multilingual text search engine library, providing full-text search, fuzzy matching, phonetic scoring, document indexing and more, with micro JSON state hydration/dehydration in-browser and server-side.
"Why don't we have a decent, Lucene-like client-side (in-browser) search engine by now?"
This library provides Lucene-like full-text search features for the browser and Node.js.
This search engine uses several advanced algorithms to provide robust and efficient searching over a large collection of documents. The algorithms used include TF-IDF for weighing and ranking, BK-Tree for fuzzy matching, BM25 for relevance scoring, and Damerau-Levenshtein distance for measuring the edit distance between search terms. The search engine supports multiple languages and uses stemming and stopword removal to enhance its efficiency. It also supports the storage and retrieval of metadata associated with the documents. You can generate an index from a text corpus and metadata both on client- and server-side. You can hydrate and re-hydrate (reuse a pre-generated) the index as well on both client- and server-side.
I want to use a Lucene-like index that uses TF-IDF vectorization, BM25 and BKTree ranking as well as snowball stemming by and stopwords on client side.
I want to generate the search index either on client side or server-side (and re-hydrate/re-use it on client or server-side). State information should be small and compressed.
The full-text search shall be fast and efficient, not leading to alot of false-positives or false-negatives.
The search engine should be able to retreive and search in metadata that may be associated with each document.
The search engine should be able to remove/update it's index' documents.
State shall be hydratable.
en
, de
, fr
, es
, ja
8 KiB
nano sized (ESM, gizpped, base library)yarn add clientside-search
npm install clientside-search
import { SearchEngine } from 'clientside-search'
import en from 'clientside-search/en'
// create a new instance of a search engine
const searchEngine = new SearchEngine(en)
// add some text
const docId1 = searchEngine.addDocument('The quick brown fox jumps over the lazy dog')
// you can also add UTF8 text, and metadata
const docId2 = searchEngine.addDocument('The quick brown fox jumps over the fence ✅', {
// metadata with index_ prefix will be indexed for search
index_title: 'Fence',
date: new Date(),
author: 'John Doe',
})
/**
* {
* id:
* score: 1.34,
* metadata: { title: 'Fence', date: '2023-07-12 ...', author: 'John Doe' }
* }
*/
const searchResult = searchEngine.search('Fence')
// if you want to persist the index state,
// hydratedState is a JSON string that you can persist
const hydratedState = searchEngine.hydrateState()
// PLEASE NOTE: The hydrated state does NOT contain the original input text
// It contains an optimized representation of the search index
// However, metadata is kept 1:1
// you can re-hydrate from that state anywhere,
// on the server or the client:
const hydratedEngine = SearchEngine.fromHydratedState(hydratedState, en)
// equals: searchResult
const searchResultFromHydated = hydratedEngine.search('Fence')
const { SearchEngine } = require('clientside-search')
const { en } = require('clientside-search/en')
// same API like ESM variant
FAQs
A highly efficient, isomorphic, full-featured, multilingual text search engine library, providing full-text search, fuzzy matching, phonetic scoring, document indexing and more, with micro JSON state hydration/dehydration in-browser and server-side.
The npm package clientside-search receives a total of 3,349 weekly downloads. As such, clientside-search popularity was classified as popular.
We found that clientside-search demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.