New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@buggyorg/library-client

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@buggyorg/library-client

Client implementation for Buggy library access.

latest
npmnpm
Version
0.4.2
Version published
Weekly downloads
6
-25%
Maintainers
1
Weekly downloads
 
Created
Source

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.

MethodDescription
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))

FAQs

Package last updated on 21 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts