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

@dkodemonkey-llc/ns-sdk

v1.1.0

Published

NetSuite SuiteScript Development SDK - Libraries for search conversion, error handling, OAuth, and more

Readme

NS-SDK

A comprehensive NetSuite SuiteScript Development SDK providing libraries for search conversion, error handling, OAuth authentication, record operations, and more.

Features

  • SuiteQLHelper - Convert NetSuite Saved Searches to SuiteQL queries automatically
  • Currency - Precision currency handling with integer-based arithmetic
  • searchHelper - Utilities for working with N/search API
  • recordHelper - Record operation helpers
  • errorHelper - Standardized error handling and logging
  • oauth1.0 - OAuth 1.0 authentication utilities
  • Third-party libraries - Moment.js and PapaParse for date/time and CSV handling

Installation

Prerequisites

  1. Enable SDF for your NetSuite Account

  2. Install SDF CLI locally

Deployment

  1. Clone this repository
  2. Deploy the src folder to NetSuite using SDF
  3. Add the following to your script headers for shorthand library access:
    /**
     * @NAmdConfig /SuiteScripts/NS-SDK/ns-sdk-amd.json
     */

Quick Start

Using SuiteQLHelper

define(['N/query', 'SuiteQLHelper'], function(query, SuiteQLHelper) {
    // Convert a saved search to SuiteQL
    const result = SuiteQLHelper.convertSearchToSuiteQL({ id: 2413 });
    const sqlQuery = result.sql;

    // Run the query
    const results = query.runSuiteQL({ query: sqlQuery }).asMappedResults();
});

Using Currency

define(['Currency'], function(Currency) {
    const amount = new Currency(100.50);
    const tax = amount.multiply(0.08);
    const total = amount.add(tax);

    // Works directly with NetSuite fields
    record.setValue('amount', total);  // Sets 108.54
});

Using searchHelper

define(['N/search', 'searchHelper'], function(search, searchHelper) {
    const mySearch = search.create({
        type: search.Type.TRANSACTION,
        filters: [['type', 'anyof', 'SalesOrd']],
        columns: ['tranid', 'trandate', 'amount']
    });

    // Get all results as JSON
    const results = searchHelper.getAllResults(mySearch, true, true);
});

Library Documentation

Development

Running Tests

npm test                # Run all tests
npm run test:watch      # Run tests in watch mode
npm run test:coverage   # Generate coverage report

Linting

npm run lint            # Check for linting errors
npm run lint:fix        # Fix linting errors automatically

VS Code Snippets

This project includes VS Code snippets for NetSuite script boilerplate. The snippets are automatically available when you open this project in VS Code.

Available snippets:

  • ue-before - User Event Before Submit
  • ue-after - User Event After Submit
  • mr-getinput - Map/Reduce Get Input Stage
  • mr-map - Map/Reduce Map Stage
  • mr-reduce - Map/Reduce Reduce Stage
  • mr-summarize - Map/Reduce Summarize Stage
  • And more...

Project Structure

ns-sdk/
├── src/FileCabinet/SuiteScripts/NS-SDK/
│   ├── lib/                          # Core libraries
│   │   ├── SuiteQLHelper.js         # Search to SuiteQL converter
│   │   ├── Currency.js              # Precision currency handling
│   │   ├── searchHelper.js          # Search utilities
│   │   ├── recordHelper.js          # Record operations
│   │   ├── errorHelper.js           # Error handling
│   │   ├── oauth1.0.js              # OAuth utilities
│   │   ├── moment.min.js            # Date/time library
│   │   └── papaparse.min.js         # CSV parsing
│   └── ns-sdk-amd.json              # AMD module config
├── test/                             # Unit tests
├── docs/                             # Documentation
├── .vscode/                          # VS Code snippets
└── .claude/                          # AI assistant documentation

Contributing

This is an internal development SDK for DKODEMONKEY LLC. For issues or questions, please contact the development team.

License

MIT

Author

DKODEMONKEY LLC