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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@opoint/opoint

v0.0.2

Published

Client wrappers around the oPoint API.

Downloads

4

Readme

oPoint realtime news feed API client

Installation

$ npm install --save @opoint/storedsearch
$ npm install --save-dev @opoint/types

Using stored search

See tests/stored-search.test.ts and @opoint/types for more options.

import { StoredSearch } from '@opoint/storedsearch'
// Pass your API key to the constructor
const api = new StoredSearch({ api_key: process.env.OPOINT_API_KEY })

// ...
// Add a new stored search
const props: StoredSearchAddProps = { search: "Anthropic"}
const res = await api.add(props)

// List current stored searches
const res = await api.list()
const body = res.data as StoredSearchListResponse

// Retrieve a stored search
const params: StoredSearchRetrieveProps = {
  id: 0, // some stored search id
}
const res = await api.retrieve(params)
const body = res.data as StoredSearchRetrieveResponse

// Retrieve data from all stored searchs
const params: StoredSearchFeedProps = {
  from: 0,      // A Unix timestamp (in seconds since epoc)
  format: 'json' as FormatEnum, // or `xml`
  num_art: 50,  // Number of articles to return
}

const res = await api.feed(params)
const body = res.data as StoredSearchFeedResponse
// A list of documents since `from`
const documents: Array<DocumentProps> = body.searchresult.document

// (Not implemented) Retrieve data from all stored searchs filted by group

// Update a stored search
const params: StoredSearchUpdateProps = {
  id: 0, // some stored search id
  search: "Anthropic Claude"
}
const res = await api.update(params)
const body = res.data as StoredSearchUpdateResponse

// Delete a stored search
const props: StoredSearchDeleteProps = {
  id: searches[0]?.id
}
const res = await api.delete(props)
// Returns res.response.status = 204 no content

Contributing

Tests

$ npm install --dev
$ npm run tests

Add a new package

Following this pattern: https://www.yieldcode.blog/post/npm-workspaces/ https://stackoverflow.com/questions/72055371/npm-workspaces-typescript-unable-to-find-local-modules

$ npm init --workspace packages/types --scope @opoint -y
$ ls -la node_modules/@opoint/

Require a new package

$ npm install @opoint/types --workspace ./packages/storedsearch
$ cat packages/storedsearch/package.json | grep -C1 opoint
$ npm ls