
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
@yashatreya/re-search-js
Advanced tools
npm install @yashatreya/re-search-js
const ReSearch = require('re-search');
const client = new ReSearch('projectID', 'admin-apiKey','indexName');
/**
* Method 1: addSchema()
* Equivalent to the `SCHEMA` argument in `FT.CREATE` command of the redis search
* This helps the search API know which fields to search from.
*
* SchemaFieldObject: {
* type: 'TEXT' | 'NUMERIC'
* field: 'fieldName'
* sortable: boolean
* }
*
* client.addSchema(array: SchemaFieldObject[])
* Takes array of objects as parameter
*/
/**
* @param {array} array - array of objects
* @return Promise
*/
client.addSchema([
{
type: 'TEXT',
field: 'fieldName',
sortable: true,
},
{
type: 'NUMERIC',
field: 'fieldName',
sortable: true,
},
{
type: 'NUMERIC',
field: 'fieldName',
sortable: true,
}
]);
/**
* Method 2: saveObjects
* data = {
* objectID: 'string' - This is a mandatory field which has the value of type string. It is a unique ID for your object
* [key]: [value]
* ....
* }
* client.saveObjects(array: data[]) - Takes array of objects as parameter
*
* Currently the saveObjects is limited to only 500 objects per request
*/
const array = require("randomArray.json");
/**
* @param {array} array - array of objects
* @return Promise
*/
client.saveObjects(array)
/**
* Method 3: removeObjects
*
* client.removeObjects(array: string[]) - Takes array of strings(objectIDs) as parameter
*
* @param {array} - array of objectID's
* @return Promise
*/
const arr = ['123', '2acfe', 'wvr345'];
client.removeObjects(arr);
FAQs
JS client for re-search
We found that @yashatreya/re-search-js 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.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.