Giter VIP home page Giter VIP logo

nscabinet's Introduction

nscabinet NPM version Build Status Coveralls Status

Upload/download files to a netsuite account, using the included restlet.

PS: This is actually also a gulp plugin. A gulp-nscabinet wrapper module is also available.

Required

  • node.js 4+

Install Dependency Status devDependency Status

    npm install nscabinet

Input options

The parameters may be stored in ~/.ns/nsconfig.json, in environment variables, or passed directly.

For environment variables, prefix the options with "NSCONF_" and write in uppercase.

The following priority is taken for each parameter (using _.extend)

  1. Direct code input

  2. ./nsconfig.json, then ../nsconfig.json, up to 3 levels.

  3. ~/.ns/nsconfig.json

  4. Environment variables

nscabinet.upload

var nscabinet = require('nscabinet') ,
	vinylfs = require('vinyl-fs')

vinylfs.src('foo.js')
	.pipe(nscabinet({
		email : '[email protected]' ,
		password : '123456' ,
		account : '123456' ,
		realm : 'sandbox.netsuite.com' ,
		role : 3 ,
		rootPath : 'SuiteScripts/MyProject'
		script : 95 ,
		deployment : 1
	}))
  • realm defaults to system.netsuite.com.

  • role defaults to the account's default role.

  • deployment defaults to 1.

  • rootPath defaults to /SuiteScripts. Must begin with /.

nscabinet.download( files , [opts] )

nscabinet.download(['MyProject/*.js','/Web Site Hosting Files/My Site/*.html'])
	.pipe(vinylfs.dest('local'))
  • files file selector (one or many).

    • * is accepted on the file part, which is replaced by % on the netsuite file search.

    • Paths are also relative to opts.rootPath. If a file selector begins with /, files will be queried by absolute path in netsuite, but saved locally inside the cabinet_root folder.

  • opts The same options as seen in upload.

CLI

npm install -g nscabinet
$ nscabinet u "file.txt" --rootpath "/SuiteScripts/MyProject"
$ nscabinet u "file.txt" -p "/SuiteScripts/MyProject"
$ nscabinet u "file.txt"
$ nscabinet d "remote.txt" --rootPath "/Downloads"
$ nscabinet d "remote.txt" -p "/Downloads"
$ nscabinet d "remote.txt"

Takes in the same arguments (lowercased).

Encase path parameters in string quotes (avoids bash expansion).

As usual, the arguments are defaulted from nsconfig.json.

Sent file paths are taken relative to the config file path. Ex:

$ nscabinet u file.txt
Uploading file.txt to /SuiteScripts
$ cd Views
$ Views nscabinet u view.html
Uploading Views/view.html to /SuiteScripts

Gulp tasks

gulp/development.js is for straightforward tasks: lint and unit tests.

gulp/test.js is for more involved things.

nscabinet's People

Contributors

danieljoppi avatar

Watchers

Lavi Yatziv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.