New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cher-api

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cher-api

API for Cher

  • 0.6.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51
increased by1175%
Maintainers
1
Weekly downloads
 
Created
Source

Quick Start


  var CherAPI = require( 'cher-api' );
  var opts    = {};
  var env     = {};
  var cher    = // ... obtain a cher instance

  var adminApi  = CherAPI( cher, env, opts ).admin();

  adminApi.start( 'twitter' )
    .spread( ( twitterDataChannel, twitterSettings ) => {
      // twitterDataChannel is a plain old nodejs stream
      twitterDataChannel.on( 'data', ( data ) => {
        console.log(data) // { ... }
      });
    });

  // If you want stats on the data you can get them on demand
  adminApi.fetchStats()
    .then( ( stats ) => {
      console.log(stats); // { unmoderated: { twitter: 10 } }
    });

  // To run stats in the background and get updated when they're available
  var statsChannel = adminApi.getStatsChannel();

  // channel is a plain old nodejs stream
  statsChannel.on( 'data', ( data ) => {
    console.log( data ); // { ... }
  });

  adminApi.startStatsEngine();

  // To be notified when a source's state changes...
  var metaChannel = adminApi.getMetaChannel();
  metaChannel.on( 'sourceStateChange', ( data ) => {
    console.log(data): // { source: 'twitter', change: 'stopped' }
  });

Full API documentation can be found on the wiki

FAQs

Package last updated on 07 Dec 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc