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 🙏

© 2026 – Pkg Stats / Ryan Hefner

simple-in-out

v0.2.5

Published

Simple In/Out API Wrapper

Readme

Simple In/Out API Wrapper for Node.js

See Simple In/Out API documentation for more details.

Installation

npm install simple-in-out

Usage

Compatible with Node.js >= 0.12.0 or io.js >= 1.0.0.

All methods return native promises.

With AWS S3 Credential Storage

var SimpleInOut = require("simple-in-out");

var client_a = new SimpleInOut({
  client_id: process.env.SIMPLE_IN_OUT_CLIENT_ID,
  client_secret: process.env.SIMPLE_IN_OUT_CLIENT_SECRET,
  redirect_uri: process.env.SIMPLE_IN_OUT_REDIRECT_URI,
  aws_access_key_id: process.env.AWS_ACCESS_KEY_ID,
  aws_secret_access_key: process.env.AWS_SECRET_ACCESS_KEY,
  aws_s3_bucket: process.env.SIMPLE_IN_OUT_CREDENTIALS_S3_BUCKET,
  aws_s3_key: process.env.SIMPLE_IN_OUT_CREDENTIALS_S3_KEY
});

var client_b = new SimpleInOut({
  client_id: process.env.SIMPLE_IN_OUT_CLIENT_ID,
  client_secret: process.env.SIMPLE_IN_OUT_CLIENT_SECRET,
  redirect_uri: process.env.SIMPLE_IN_OUT_REDIRECT_URI,
  aws_access_key_id: process.env.AWS_ACCESS_KEY_ID,
  aws_secret_access_key: process.env.AWS_SECRET_ACCESS_KEY,
  aws_s3_bucket: process.env.SIMPLE_IN_OUT_CREDENTIALS_S3_BUCKET,
  aws_s3_key: process.env.SIMPLE_IN_OUT_CREDENTIALS_S3_KEY
});

client_a.get_access_token(process.env.SIMPLE_IN_OUT_AUTHORIZATION_CODE).then(function(){
  // Credentials are stored on AWS S3 after initialization with authorization code
  return client_a.ok();
}).then(function(result){
  assert(result.version);
  // Credentials fetched from AWS S3
  return client_b.ok();
}).then(function(result){
  assert(result.version);
});

Without AWS S3 Credential Storage

With an authorization code:

var SimpleInOut = require("simple-in-out");

var client_a = new SimpleInOut({
  client_id: process.env.SIMPLE_IN_OUT_CLIENT_ID,
  client_secret: process.env.SIMPLE_IN_OUT_CLIENT_SECRET,
  redirect_uri: process.env.SIMPLE_IN_OUT_REDIRECT_URI
});

var client_b = new SimpleInOut({
  client_id: process.env.SIMPLE_IN_OUT_CLIENT_ID,
  client_secret: process.env.SIMPLE_IN_OUT_CLIENT_SECRET,
  redirect_uri: process.env.SIMPLE_IN_OUT_REDIRECT_URI
});

client_a.get_access_token(process.env.SIMPLE_IN_OUT_AUTHORIZATION_CODE).then(function(credentials){
  // Credentials can be set directly, bypassing get_access_token()
  return client_b.set_credentials(credentials);
}).then(function(){
  return client_a.ok();
}).then(function(result){
  assert(result.version);
  return client_b.ok();
}).then(function(result){
  assert(result.version);
});

With access and refresh tokens:

var SimpleInOut = require("simple-in-out");

var client = new SimpleInOut({
  client_id: process.env.SIMPLE_IN_OUT_CLIENT_ID,
  client_secret: process.env.SIMPLE_IN_OUT_CLIENT_SECRET,
  redirect_uri: process.env.SIMPLE_IN_OUT_REDIRECT_URI,
  access_token: process.env.SIMPLE_IN_OUT_ACCESS_TOKEN,
  refresh_token: process.env.SIMPLE_IN_OUT_REFRESH_TOKEN
});

client.ok().then(function(result){
  assert(result.version);
});

API

new SimpleInOut(options)

Simple In/Out API client constructor.

Required:

  • options.client_id: Simple In/Out application ID string.
  • options.client_secret: Simple In/Out secret string.
  • options.redirect_uri: Simple In/Out redirect URI.

Required for AWS S3 credential storage:

  • options.aws_access_key_id: Amazon AWS access key ID string.
  • options.aws_secret_access_key: Amazon AWS secret access key string.
  • options.aws_s3_bucket: Amazon AWS S3 bucket name string. Bucket must exist.
  • options.aws_s3_key: Amazon AWS S3 key string.

Optional:

  • options.access_token: Simple In/Out access token.
  • options.refresh_token: Simple In/Out refresh token.

.get_access_token([authorization_code])

Get access and refresh tokens via oAuth2 flow or from AWS S3 credential storage.

Required for use without AWS S3 credential storage, or when intializing with AWS S3 credential storage:

  • authorization_code: Authorization code from Simple In/Out oAuth2 flow.

.get_credentials_from_aws_s3()

Get access and refresh tokens from AWS S3 credential storage.

.set_credentials(options)

Set access and refresh tokens. Stores credentials when used with AWS S3 credential storage.

Required:

  • options.access_token: Simple In/Out access token.
  • options.refresh_token: Simple In/Out refresh token.

.refresh_access_token()

Refresh access token. Stores credentials when used with AWS S3 credential storage.

.ok()

Verify your API client. See Simple In/Out documentation for additional details.

.company()

Retrieve company information. See Simple In/Out documentation for additional details.

.fences()

Retrieve company geofences. See Simple In/Out documentation for additional details.

.groups()

Retrieve company groups. See Simple In/Out documentation for additional details.

.statuses([query_parameters])

Retrieve current statuses. See Simple In/Out documentation for additional details.

Optional:

  • query_parameters.group_id: Group ID to restrict the list of statuses.

.current_user()

Retrieve current user. See Simple In/Out documentation for additional details.

.user(user_id)

Retrieve a user. See Simple In/Out documentation for additional details.

Required:

  • user_id: User ID.

.user_statuses(user_id, query_parameters)

Retrieve a user's usage statistics. See Simple In/Out documentation for additional details.

Required:

  • user_id: User ID.
  • query_parameters.start_date: Start date to begin with. String in the format MM/DD/YYYY.
  • query_parameters.end_date: End date of statuses, no more than 31 days from start_date, in the format MM/DD/YYYY.

Optional:

  • query_parameters.comment: Only consider “in” statuses with this comment as “in”. String.
  • query_parameters.expanded: Set to true if all statuses are to be included, otherwise defaults to aggregate statistics. Boolean.

Testing

  • Copy run-tests.sh.sample to run-tests.sh.
  • Generate an authorization code via the Simple In/Out oAuth2 flow: https://www.simpleinout.com/oauth/authorize?response_type=code&client_id=XXXXXXXX&redirect_uri=XXXXXXXX
  • Edit run-tests.sh to include AWS credentials, Simple In/Out credentials, and the authorization code.
  • Run npm test