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

nodejs-box

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodejs-box

Box API client for Node.JS

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Box API Node.JS Client

Install

npm install nodejs-box

Setup

First, you need to go through the OAuth2 process with Box.com, so that you can receive an access token. I recommend the box-passport module to help with this.

var Box = require('nodejs-box');

var box = new Box({
  access_token: 'YOUR_ACCESS_TOKEN_GOES_HERE',
  refreh_token: 'YOUR_REFRESH_TOKEN_GOES_HERE'
});

Check out the tests for more usage examples.

Folders

box.folders.info(folder_id, callback)

Returns info given a folder ID

box.folders.root(callback)

Returns info for the root folder (ID '0')

box.folders.create(folder_name, parent_folder_id, callback)

Creates a new folder, given a name and the ID of the parent folder

box.folders.delete(folder_id, recursive*, callback)

Deletes a folder, given a folder ID. Optionally takes a second argument, 'recursive', that holds a boolean value, which, if true, will delete the folder even if it is not empty.

Files

box.files.upload(path, folder_id)

Uploads a file given a path and a folder ID

box.files.createMetadata(metadata, file_id)

Create metadata for a given file (ID)

Note: Your app/account has to be authorized for the Metadata API beta to use this.

Test

Run export access_token='YOUR_TOKEN_GOES_HERE' && npm test

Keywords

FAQs

Package last updated on 09 Dec 2014

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