npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@inshel/suggestions

v0.1.0

Published

InShel suggestions client

Readme

@inshel/suggestions

Motivation

Predicting user-entered text is one of the most important and frequent tasks. @inshel/suggestions is a single serverless solution for such tasks both in the browser and for bots

Install

npm install --save @inshel/suggestions

About

Each sentence contains its own unique token and an unique set of search rated tokens.

Example

{
  id: 19283,
  token: 'CATS',
  tokens: [
    { token: 'C', rating: 1000 },
    { token: 'CA', rating: 1000 },
    { token: 'CAT', rating: 1000 },
    { token: 'CATS', rating: 1000 },
  ]
}

Usage

You can use suggestions, as encrypted storage

upsert

Params

  • key - key id. Optional (may be specified in options)
  • token - string. Required
  • rating - integer. Required
  • payload - integer. Optional (default: {})
  • tokens - tokens array. Optional

Upsert suggestion.
If suggestion does not exist, it will be created.
If suggestion exists, tokens rating will be increased

const suggestionsWithKey = new Suggestions(node, { key })
const suggestions = new Suggestions(node, { key })
  
const cats = await suggestionsWithKey.upsert('CATS', 1, { isTest: true })
const cats = await suggestions.upsert(key, 'CATS', 2, { isTest: true })
const cats = await suggestions.upsert(key, 'CATS', 3, { isTest: true }, [ 'C', 'CATS' ])

result

{
  id: 19283,
  token: 'CATS',
  tokens: [
    { token: 'C', rating: 6 },
    { token: 'CA', rating: 3 },
    { token: 'CAT', rating: 3 },
    { token: 'CATS', rating: 6 },
  ]
}

upsertMany

Upsert suggestions.
If suggestion does not exist, it will be created.
If suggestion exists, tokens rating will be increased

Upsert suggestions.

Params

  • key - key id. Optional (may be specified in options)
  • suggestions - Array of suggestions:
    • token - string. Required
    • rating - integer. Required
    • payload - integer. Optional (default: {})
    • tokens - integer. Optional
const suggestionsWithKey = new Suggestions(node, { key })
const suggestions = new Suggestions(node)
  
const [ cats, cat ] = await suggestionsWithKey.upsertMany(
  key,
  [
    { token: 'CATS', rating: 1, payload: { isTest: true }, tokens: [ 'CATS' ] },
    { token: 'CAT', rating: 1, payload: { } }
  ]
)

const [ cats, cat ] = await suggestionsWithKey.upsertMany([
  { token: 'CATS', rating: 1, payload: { isTest: true } },
  { token: 'CAT', rating: 1, payload: { } }
])

q

Returns

Params

  • key - key id. Optional (may be specified in options)
  • q - query string.
  • limit - integer. Optional (default options.qLimit)
const suggestionsWithKey = new Suggestions(node, { key })
const result = await suggestionsWithKey.q('CA')
const moreResults = await suggestionsWithKey.q('CA', 25)
  
const suggestions = new Suggestions(node)
const result = await suggestions.q(key, 'CA', 12)

Changelog

0.1.1

  • fix package name

0.1.0

First implementation

  • upsertMany
  • upsert
  • q