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

@vnetwork-solutions/ns-custom-stubs-template

v2.0.2

Published

Template for creating custom stubs for your NetSuite custom modules

Downloads

28

Readme

Introduction

This project is meant to serve as a baseline template project for getting tests implemented easier in to your NetSuite projects. Use these stubs for modules which are imported to other NetSuite SuiteCloud projects.

Using the directory path /SuiteScript/..., we can provide aliases locally for these modules while still being available in NetSuite -- as the root directory for SuiteScript files in NetSuite is /SuiteScripts/.

This project pairs with the NetSuite-CustomModules-Template tutorial/template project.

🎉 Getting Started

  1. Open ./package.json and customize the project configuration
  2. Run npm i to install project dependencies
  3. Add your module path aliases to customJestStubs.js
  4. Create a local environment variable NPM_TOKEN using your NPM token for the value
  5. Publish your npm package using npm publish

🧐 Notable Files

  • README.hbs -- Base template file the project README.md is generated from
  • npmrc -- NPM environment token loader file for publishing project
  • docsMD.config -- Wiki MD generator from JSDoc notations
  • jsDocsConf.json -- JSDocs configuration file

🔨 Scripts

Use npm run <script> to execute various commands for the project

  • npm run docs -- Generates project documentation based on JSDoc notations (Configure with docsMD.config && jsDocsConf.json)
  • npm run open-docs -- Opens documentation in browser for viewing

👷 CI/CD

Azure yaml pipeline files are provided in .ci/workflows.

Modules

aModule

Your custom NetSuite module A

Summary: This is example stub of custom NetSuite module A. It may or may not be in your SuiteCloud project. Update your jest.config.js to map this module from the stub pkg to your local project if it is available. See project jest.config.js for further examples of this.
Format:
Napiversion: 2.1
Since: 2022.2
Version: 1.0.0
License: NApiVersion

aModule(query, log) ⏏

NetSuite module A export function

Kind: Exported function

| Param | Type | Description | | --- | --- | --- | | query | Object | NS query module | | log | Object | NS log module |

aModule.GetVendorPrefix(vendorId) ⇒ String

Returns preferred vendor prefix from record or blank if no prefix is located

Kind: static method of aModule

| Param | Type | Description | | --- | --- | --- | | vendorId | String | Entity ID of vendor Ex: 4321 |

aModule.RunQuery(vendorId) ⇒ String

Returns query result of vendor prefix from vendor record

Kind: static method of aModule
Returns: String - - Returns vendor prefix string from query result
Access: protected

| Param | Type | Description | | --- | --- | --- | | vendorId | String | Vendor entity ID to run query on |

bModule

Your custom NetSuite module B

Format:
Napiversion: 2.1
Since: 2022.2
Version: 1.0.0
License: NApiVersion

bModule(log) ⏏

NetSuite module B export function

Kind: Exported function

| Param | Type | Description | | --- | --- | --- | | log | Object | NS log module |

bModule.set_CustomFieldValue(options) ⇒ undefined

Example set custom body field value for record

Kind: static method of bModule

| Param | Type | Description | | --- | --- | --- | | options | Object | Object of parameters for setting custom body field | | options.currentRecord | Record | NS Record Object to update | | options.fieldId | String | Field id on record object to update value on | | options.value | String | Value to set record field to |

Happy Coding! 🥳