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

node-box-view

v0.2.1

Published

Node.js client library for Box View API.

Downloads

15

Readme

Node-box-view

Node.js client library for Box View API.

Build Status

Installation

npm install node-box-view

Usage

var boxViewLib = require('node-box-view'),
	boxView = new boxViewLib(YOUR_API_KEY);

For general API documentaion, please review the Box View API Documentation.

getList(options, callback)

Fetches a list of all documents uploaded using this API Key.

  • options (object):
    • limit (int) - The number of documents to return (default=10, max=50)
    • created_before (Date) - An upper limit on the creation timestamps of documents returned (default=now)
    • created_after (Date) - A lower limit on the creation timestamps of documents returned
  • callback (function) - A callback with the following arguments:
    • an error object or null
    • JSON-parsed response data

Response example:

	{
		"document_collection": {
			"total_count": 1,
				"entries": [
					{
						"type": "document",
						"id": "e460608a44c84c02b70a020e7f516de3",
						"status": "done",
						"name": "",
						"created_at": "2013-09-12T19:01:34Z"
					}
				]
			}
	}

getDocument(documentId, fields, callback)

Retrieves the metadata for a single document.

  • documentId - Document ID
  • fields ()- Array of fields to return (id and type are always)
  • callback (function) - A callback with the following arguments:
    • an error object or null
    • JSON-parsed response data

Response example:

	{
		"type": "document",
		"id": "documentId",
		"status": "done",
		"name": "Leaves of Grass",
		"created_at": "2013-08-30T00:17:37Z"
	}

uploadFile(file_path, options, callback)

Uploading a document from url.

  • file_path (string) - A path to a file to read
  • options (object):
    • fileName (string) - The name of the file. If options.params.name is not set, it will be inferred from the file path.
    • thumnails(string) - Comma-separated list of thumbnail dimensions of the format {width}x{height} (e.g. '128×128,256×256') – width can be between 16 and 1024, height between 16 and 768
    • non_svg (boolean) - Whether to also create the non-svg version of the document, default=false. read more here
  • callback (function) - A callback with the following arguments:
    • an error object or null
    • JSON-parsed response data

Response example:

	{
		"type": "document",
		"id": "2da6cf9261824fb0a4fe532f94d14625",
		"status": "processing",
		"name": "",
		"created_at": "2013-08-30T00:17:37Z"
	}

uploadFromUrl(url, callback)

Uploading a document from file.

  • url (string) - The URL of the ocument to be converted.
  • options (object):
    • fileName (string) - The name of the file. If options.params.name is not set, it will be inferred from the file path.
    • thumnails(string) - Comma-separated list of thumbnail dimensions of the format {width}x{height} (e.g. '128×128,256×256') – width can be between 16 and 1024, height between 16 and 768
    • non_svg (boolean) - Whether to also create the non-svg version of the document, default=false. read more here
  • callback (function) - A callback with the following arguments:
    • an error object or null
    • JSON-parsed response data

Response example:

	{
		"type": "document",
		"id": "2da6cf9261824fb0a4fe532f94d14625",
		"status": "done",
		"name": "",
		"created_at": "2013-08-30T00:17:37Z"
	}

getDocumentThumbnail(documentId, width, height, file, callback)

Retrieve a thumbnail image of the first page of a document. Thumbnails can have a width between 16 and 1024 pixels and a height between 16 and 768 pixels.

  • documentId (string) - Document ID.
  • width (int) - The width of the thumbnail in pixels, between 16 and 1024
  • heigth (int) - The height of the thumbnail in pixels, between 16 and 768
  • file (string) - PNG thumbnail destination file path (include file name and extention)
  • callback (function) - A callback with the following arguments:
    • an error object or null
    • JSON-parsed response data

updateDocument(documentId, options, callback)

Updates the metadata of a specific document.

  • documentId (string) - Document ID
  • options (object):
    • name (string) - The name of the document
  • callback (function) - A callback with the following arguments:
    • an error object or null
    • JSON-parsed response data

deleteDocument(documentId, callback)

Removes a document completely from the View API servers.

  • documentId (string) - Document ID.
  • callback (function) - A callback with the following arguments:
    • an error object or null
    • JSON-parsed response data

getDocumentSession(documentId, callback)

Create a session to view the document.

  • documentId (string) - Document ID.
  • callback (function) - A callback with the following arguments:
    • an error object or null
    • JSON-parsed response data