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

@fnndsc/chrisapi

v1.22.0

Published

JavaScript6 client for the ChRIS API

Downloads

238

Readme

ChRIS API

Build Status

JavaScript 6 client for the ChRIS API.

Installation

npm i @fnndsc/chrisapi

API Documentation

If you have a ChRIS server up and running (eg. as explained below) then you can test the API in your Javascript code.

For more information visit the API documentation

Development and testing

ChRIS server preconditions

These preconditions are only necessary to be able to test the client against an actual instance of a ChRIS server both during development and for the automated tests.

Install latest Docker and Docker Compose.

Currently tested platforms:

  • Docker 18.06.0+
  • Docker Compose 1.27.0+
  • Ubuntu 18.04+ and MAC OS X 10.14+

On a Linux machine make sure to add your computer user to the docker group

Fire up the full set of ChRIS services:

Open a terminal and run the following commands in any working directory:

$> git clone https://github.com/FNNDSC/ChRIS_ultron_backEnd.git
$> cd ChRIS_ultron_backEnd
$> ./make.sh -U -I -i

Check that all the services are up:

$> docker ps -a

Create a test feed by making the following POST request:

Using curl:

curl -u cube:cube1234 -XPOST -H 'Content-Type: application/vnd.collection+json' -H 'Accept: application/vnd.collection+json' -d '{"template":{"data":[{"name":"dir", "value":"home/cube/uploads"}]}}' 'http://localhost:8000/api/v1/plugins/2/instances/'

Using HTTPie REST API client:

http -a cube:cube1234 POST http://localhost:8000/api/v1/plugins/2/instances/ template:='{"data":[{"name":"dir", "value":"home/cube/uploads"}]}' Content-Type:application/vnd.collection+json Accept:application/vnd.collection+json

Update the feed's files by making the following GET request:

Using curl:

curl -u cube:cube1234 http://localhost:8000/api/v1/plugins/instances/1/

Using HTTPie REST API client:

http -a cube:cube1234 http://localhost:8000/api/v1/plugins/instances/1/

Keep making this GET request until the "status" descriptor in the response becomes "finishedSuccessfully"

Tear down the full set of ChRIS services:

You can later remove all the backend containers and release storage volumes with:

$ cd ChRIS_ultron_backEnd
$ ./unmake.sh

JavaScript package manager prerequisite

  • yarn

Open a terminal in the directory of this README file

Commands

Install dependencies

$> yarn install

Start tests in watch mode (used for developing)

$> yarn start

Start test in single run mode (used by Travis CI)

$> yarn test

Compile library to standalone bundle

$> yarn build

Generate source code documentation

$> yarn docs