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

blackbox-cli

v1.0.1

Published

Blackbox command line interface.

Downloads

5

Readme

blackbox-cli

Version standard-readme compliant

Blackbox command line interface.

The Blackbox command line interface (CLI) provides support for managing a Blackbox project. Project configuration is stored in the blackbox.json file and the OpenAPI definitions are stored in the openapi.json file. The CLI can be used to manage datatypes and services required by your project.

A Blackbox project is a project that provides a REST API conforming to the Blacbkox specification. The Blackbox specification provides standards for developing a REST API based on service and datatype definitions. The services and datatypes are defined within an OpenAPI document.

For further information about the Blackbox Specification refer to the Blackbox website.

Table of Contents

Install

npm i -g blackbox-cli

Usage

bb command [type] [options]

Commands

|Command|Description| |---|---| |init|Initialises the Blackbox project with a root OpenAPI JSON file named openapi.json and a bb.json config file.| |add|Adds a Blackbox API component of a given type to the project.| |list|Lists all Blackbox API components of a given type that exist within the project.| |update|Changes an existing Blackbox API component. The component is identified by its type and name.| |delete|Deletes an existing Blackbox API component. The component is identified by its type and name.| |analyse|NOT YET IMPLEMENTED: Analyses the Blackbox API specification within the openapi.json file and identifies any lack of compliance to the Blackbox Specification.|

Types

|Type|Description| |---|---| |service|A blackbox service.| |datatype|A datatype for use by services.| |repository|A datatype repository for storing and loading datatype definitions.|

Options

|Option|Description| |---|---| |--all, -a|Apply operation to all relevant items. E.g. bb delete service -a -n s1 will remove service s1 and any child services.| |--datatype, -d|The data type of a service.| |--desc|The description of the API| |--file, -f|A source file to read in data appropriate to the command and type.| |--methods, -m|The HTTP methods to be supported by the service.| |--name, -n|The name of the entity being added or modified.| |--service, -s|The parent service in the case of sub-services. Defaults to no parent; i.e. a root level service.| |--summary|Summary for a service.| |--title, -t|The title of the API| |--url, -u|A source url to read in data appropriate to the command and type.|

Examples

Initialise the blackbox project:

bb init -n weather -t "A weather API." --desc \
"An API for retrieving temperature and humidity information."

Add a remote repository (the repository will be added to your blackbox.json):

bb add repository --url http://example.com/repositories/maths.json

Add a datatype from a local file (the datatype will be added to your openapi.json):

bb add datatype --name temperature --file types.json

Add a service:

bb add service --name weather --summary \
"Weather service: Provides temperature and humidity information."

Add a sub-service:

bb add service --name temperature --service weather --summary \
"Returns a temperature object."

Assign the datatype for a service (the datatype must be primitive, already added to the openapi.json, or exist in a repository added to your blackbox.json; note that --service refers to the parent service and --name refers to the child service):

bb update service --service weather --name temperature --datatype temperature --method "post,delete"

Maintainers

@ellipsistechnology

Contributing

PRs accepted.

Small note: If editing the README, please conform to the standard-readme specification.

License

MIT © 2019 Ben Millar