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

netsuite-sync

v1.2.2

Published

push files to the file cabinet

Downloads

7

Readme

NS - NetSuite Simple Sync utility

This little utility uploads your suitescript files to the NetSuite file cabinet from the command line or as a menu item or button in your IDE.

The idea is it's much faster than to fiddling with the netsuite UI to repeatedly upload a code file you're developing.

Installing

To install globally

npm install -g netsuite-sync

The commandline program is named ns

Get help with ns --help

Getting Started

This utility uploads files to a specific folder in your NetSuite file cabinet. We've found it a best practice to keep all suitescripts in a single folder if possible.

(Windows Users Note) We recommend you install Git Bash and run all this stuff in the bit bash shell.

  1. Login to your NetSuite account and navigate to the folder you want to upload to - note the internal id of the folder.

  2. Set a password as an in-memory environment variable - this is used to encrypt the generated config file

    export NSPW="mypassword"

  3. Generate a config file with the -g or --gen-config option

    ns -g

Answer the prompts and supply the internal id of the destination folder you noted in step 1. This will generate both the encrypted and unencrypted NetSuiteConfig file.

  1. Upload a file

    ns -u SomeScriptFile.js

  2. Confirm the file is there in NetSuite, then delete the plaintext NetSuiteConfig.js file.

More Detail

Although generating a config with the --gen-config option is the easiest way to go, you can do it more manually with steps described in this section.

Set your password

The following sets your password to 'foo'. Note you need to run this prior to running the utility. For an example of creating a script to launch WebStorm see here todo:add link

export NSPW="foo"

Create NetSuite Config

This tool uses SuiteTalk (NetSuite web services) to send files to the file cabinet. Hence it needs some configuration connection info stored locally. This connection info is stored in a file named NetSuiteConfig.js which is encrypted to NetSuiteConfig.js.enc

To generate a config file run with the --gen-config option:

ns -g

Answer the prompts. You can review the settings in the generated NetSuiteConfig.js file. Do remember to delete this file after you've confirmed it works (e.g. after you've successfully uploaded a file). Only NetSuiteConfig.js.enc is needed at runtime.

You can manually encrypt a NetSuiteConfig.js file with the --encrypt option.

Fill out your plaintext NetSuiteConfig.js file, then encrypt it:

ns --encrypt-config

Then delete your plaintext NetSuiteConfig.js

If you ever need to check the config, use --decrypt-config:

ns --decrypt-config

To help setup a new config file:

ns --geturl

Upload a suitescript file to NS

ns -u filename

or

ns --upload filename

...pushes filename to the NS file cabinet under the folder specified in NetSuiteConfig.js

Development/Tech notes

First step: npm install to pull in all dependencies.

Debugging

The webstorm regular node debug session doesn't seem to support interactive programs. So, launch the program in a separate terminal window like:

node --debug-brk=5858 ./ns.js 

Then create a node remote debug session using this port and run it.

To just spew debug messages to the console, define an environment variable before launching like:

DEBUG=ns node ./ns.js
XML files

XML files under /lib named <operation>Template.xml are SOAP snippets representing the NetSuite web service operation

For example, getTemplate.xml is the get operation as described in the NetSuite wsdl.