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

docscout

v2.0.0

Published

NodeJS client for HelpScout Docs API

Downloads

7

Readme

DocScout

NodeJS client for HelpScout Docs API written in TypeScript

Install

$ npm install docscout

Usage

Functional

import { listCollections } from 'docscout/collections'

const apiToken = process.env.HELPSCOUT_DOCS_API_TOKEN;

(async () => {
  try {
    const collectionsEnvelope = await listCollections(apiToken, { visibility: 'private', sort: 'createdAt', order: 'asc'  });
    console.log(JSON.stringify(collectionsEnvelope, null, 2));
  } catch (error) {
    console.error(error);
  }
})();

OOP Client Instance

The OOP Client has two subtle differences from the functional approach:

import DocscoutClient from 'docscout'

const apiToken = process.env.HELPSCOUT_DOCS_API_TOKEN;

(async () => {
  try {
    const docscoutClient = new DocscoutClient(apiToken);
    const collections = await docscoutClient.listCollections({
      visibility: 'private',
      sort: 'createdAt',
      order: 'desc'
    });
    console.log(JSON.stringify(collections, null, 2));
  } catch (error) {
    console.error(error);
  }
})();

API

Version 1 of this client focuses on fetching data, i.e. the API Reads.
We'll happily welcome your PRs to improve this client.

Articles | Source Code

List Articles | Docs

In Collection
listArticlesInCollection( apiToken: string, collectionId: string, options?: ListArticleOptions )
In Category
listArticlesInCategory( apiToken: string, categoryId: string, options?: ListArticleOptions )

Search Articles | Docs

searchArticles( apiToken: string, options: SearchArticlesOptions )

List Related Articles | Docs

listRelatedArticles( apiToken: string, articleId: string, options?: ListRelatedArticlesOptions )

List Revisions | Docs

listRevisions( apiToken: string, articleId: string, options?: ListRevisionsOptions )

Get Article | Docs

getArticle( apiToken: string, articleIdOrNumber: string | number, options?: GetArticleOptions )

Get Revision | Docs

getRevision( apiToken: string, revisionId: string )

Assets | Source Code

Create Article Asset | Docs

createArticleAsset( apiToken: string, options: CreateArticleAssetOptions )

Categories | Source Code

List Categories | Docs

listCategories( apiToken: string, collectionId: string, options?: ListCategoriesOptions )

Get Category | Docs

getCategory( apiToken: string, categoryIdOrNumber: string | number )

Collections | Source Code

List Collections | Docs

listCollections( apiToken: string, options?: ListCollectionsOptions )

Get Collection | Docs

getCollection( apiToken: string, collectionIdOrNumber: string | number )

Sites | Source Code

List Sites | Docs

listSites( apiToken: string, options?: ListSitesOptions )

License

Copyright (c) 2019 You Need A Budget, LLC

Licensed under the Apache-2.0 license