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

@buggyorg/library-client

v0.4.2

Published

Client implementation for Buggy library access.

Downloads

8

Readme

Buggy Library-Client

The client implementation for Buggy library access.

Usage

The Buggy Library uses a REST Interface. You can either connect to an external server or create a local server via a JSON document.

The API exposes the following methods:

  • fromFile(file): Specify a local JSON file. The client will start a local REST server and connect to it.
  • fromJSON(json): Specify a JSON document as a Javascript Object. The client will start a local REST server and connect to it.
  • connect(URL): Connect to a server via an URL like 'http://localhost:8818'.

All three methods return the same promise-based API to access and manipulate the library.

| Method | Description | |-------------------|-------------------------------------| |info() | Get basic server information like library version and server type. | |components() | Get all components in the library. | |componentCount() | Get the number of all components defined in the library | |component(meta, [version]) | Get a specific component with a given meta key. The version is optional and it will get the newest version if no version is specified. | |addComponent(component) | Insert a new component via a JSON object. The component must be valid and it must be the only component with that meta key in that version. | |meta(component, [key], [version])| Get meta information for a component. The key and version are optional, if you don't define them you get all keys of the latest versionen. You can omit the version or the key by not specifying them or setting them to null. | |addMeta(component, key, value, [version])| Add meta information for a component and a specific key. If you don't specify a version the key will be set in the latest version. | |config(key) | Get the configuration value for a specific key. | |setConfig(key, value) | Set the configuration Value for a specific key. | |export() | Get a copy of the whole database. |

You can find the API docs here.

Example

import {fromFile} from '@buggyorg/library-client'

var client = fromFile('myLibrary.json')
client.info()
  .then((info) => console.log(info))