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

@sfg20/cli

v1.2.3

Published

CLI tool to retrieve SFG20 information

Downloads

5

Readme

SFG20 Extractor

This is an ISC licensed utility to access the SFG20 maintenance regime data. You must have the appropriate share link and access tokens in order to successfully use this tool, the share link code is available from a licensed SFG20 user, and the access token is available from SFG20 for approved API partners.

Installation

npm i -g sfg20-api-extractor

This will install the sfg20 CLI tool as globally available.

Usage

To get the up-to-date help type the following into a terminal

sfg20 --help

You may also get help for specific commands:

sfg20 xml --help

Extracting Data

The utility enables you to extract data in either XML or JSON formats using the commands sfg20 xml and sfg20 json. The extraction commands require two keys and the type of query to run to extract the data.

Template:

sfg20 xml A_SHARE_LINK YOUR_ACCESS_TOKEN BUILT_IN_QUERY

You can get a list of the current built in queries by typing:

sfg20 list 

This will list the available queries, e.g.: tasks, schedules and frequencies

You may also supply your own query file instead of using a built in query using the --query (-q) option:

sfg20 xml ABCD12345678 XYZ12345678 --query ./my-query.txt

Output to a file

By default, the utility writes the output to the terminal, you can direct it to a file with the --file (-f) option:

sfg20 json ABCD12345678 XYZ12345678 tasks --file ./tasks.json

Override API URL

If you want to use a different URL for the API, you can use the --url (-u) option

sfg20 xml ABCD12345678 XYZ12345678 tasks --url http://localhost:3000/v3.0

Output Changes

The tool allows you to output only changes to the shared data since a date using the --since (-s) option:

sfg20 json ABCD12345678 XYZ12345678 tasks --since 2023-08-30

When requesting changes you can see a status (_status in JSON) attribute indicating Changed or Added.

Deleted records will have a type (__typename in JSON) attribute set to DeletedRecord.

Changes with custom queries

In order that custom queries correctly return changes they should return the _status and __typename attributes.

Custom Queries

You can supply your own custom query as a GraphQL fragment stored in a file and passed with the --query option.

e.g.

   tasks{
      ... on APITask {
        __typename
        _status
        intervalInHours
        title
        id
        url
        linkId
        frequency {
          interval
          period
        }
        skill {
          Skilling
          SkillingCode
          CoreSkillingID
        }
        schedule {
          title
          code
        }
        content
        classification
        minutes
        steps
      }
      ... on DeletedRecord {
        __typename
        id
      }
    }

The API provides a GraphQL playground available on its URL, you can use this to build regime queries and then copy the return data specification into the file.

(c) 2023 BESA Publications Limited

Author: Mike Talbot (et al)