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

clara

v0.4.11

Published

Clara.io API wrapper

Downloads

14

Readme

Clara.io api bindings for node.js

Installation

npm install clara

Quick start

$ npm install clara
$ clara set apiToken <api-token>
$ clara set username <username>
$ clara scenes:get <uuid>

API Overview

Create a clara instance with your api token and username:

// Visit https://clara.io/settings/api for your api token
var clara = require('clara')({apiToken: 'your-api-token', username: 'your-username'});

Every resource method returns a promise, or accepts an optional callback.

clara.scenes.list().then(function(scenes) {
}).catch(function(err) {
});

With callbacks:

clara.scenes.list({}, function(err, scenes) {
});

The parameters for each resource method are:

  • queryOptions: {Object} Any query parameters required for the call.
  • params: {Object|String} (Optional) The data for the method. If this is a string, the library will expect a filename to a json file that will be parsed and sent.
  • callback: {Function}
clara.scenes.update({sceneId: 'scene-id'}, './scene.json', function(err, result) {});
clara.scenes.create({}, function(err, newScene) {});

Command line overview

All commands are available from the command line runner as well.

$ clara --help
$ clara scenes:get --help
$ clara --apiToken <apiToken> --username <username> scenes:get <sceneId>

Available resources and methods

  • scenes:library [options] List public scenes
  • scenes:list [options] List your scenes
  • scenes:create [options] Create a new scene
  • scenes:update [options] Update a scene
  • scenes:get Get scene data
  • scenes:delete Delete a scene
  • scenes:clone Clone a scene
  • scenes:import [options] Import a file into the scene
  • scenes:export Export a scene
  • scenes:render [options] Render an image
  • scenes:command [options] Run a command
  • jobs:list [options] List your jobs
  • jobs:get Get job data
  • user:get Get User Profile
  • user:update [options] Update user profile
  • webhooks:list [options] List webhooks
  • webhooks:create [options] Create a webhook
  • webhooks:update [options] Update a webhook
  • set Set a configuration value to $HOME/.clara.json
  • get Return the current configuration for

Configuration

There are several ways to set up the configuration data, from highest to lowest priority:

  1. Pass directly (through function call, or command line).
clara --apiToken <apiToken> --username <username> scenes:get <sceneId>

Or with api:

var clara = require('clara')({apiToken: '...', username: '...'});
  1. Environment variables.

Any parameter can be passed through an environment variable, prefixed with clara_:

clara_apiToken=api-token-here clara_username=username clara scenes:get <uuid>
  1. Configuration file in current working directory

A json file named .clara.json can hold configuration data:

{
  "apiToken": "api-token-here",
  "username": "your-username"
}
  1. Configuration file in $HOME

If the configuration file .clara.json exists in $HOME, it will be used.

clara set, clara get

You can use the clara command line to quickly set/get your configuration data. It will write to $HOME/.clara.json:

$ clara set apiToken your-api-token
$ clara set username your-username
$ clara scenes:get scene-uuid

Development

Run the tests using npm:

$ npm install
$ npm tests