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

jsdoc-plugin-suitescript

v1.1.1

Published

Adds SuiteScript-related tags to the JSDoc dictionary, as well as a theme that supports the tags based on the JSDoc default theme.

Downloads

347

Readme

JSDoc SuiteScript Plugin

Adds tag definitions for several SuiteScript-related tags. Includes a template based on the JSDoc default template.

Example of generated output that uses all tags

Installation

Install the npm package:

npm i jsdoc-plugin-suitescript

The tag definitions and default template are automatically copied to the local jsdoc module folder via npm's postinstall script.

Add the plugin to your JSDoc configuration:

{
    "plugins": ["plugins/suitescript"]
}

If you use a JSDoc template other than the default, you can copy the relevant files from node_modules/jsdoc/templates/default/tmpl/ to your own template folder.

@governance

Synonyms

  • @gov

Syntax

@governance <Number|String>

@gov <Number|String>

Overview

The @governance tag is used to document the NetSuite governance usage of a function. The usage can be in the form of a Number or a text formula describing the necessary calculation.

Examples

In the following example, the documented function performs a single search, which uses 10 governance units.

/**
 * Performs a transaction search
 *
 * @governance 10
 */
function doSearch() {
    return nlapiSearchRecord('transaction') || [];
}

In the following example, the documented function submits each custom record in a given list, which uses 4 governance units per record.

/**
 * Submits each record in the given list
 *
 * @governance (4 * n), where n is the number of records in the given list
 */
function saveRecords(records) {
    if (!records.length) { return; }
    
    records.forEach(function (rec) { nlapiSubmitRecord(rec); });
}

@NApiVersion

Syntax

@NApiVersion <version>

version can be any of:

  • 1.0
  • 2.0
  • 2.x
  • 2.X

Overview

The @NApiVersion tag is used to document the SuiteScript version used by a script file or module. It can serve as a defense against future incompatible versions of SuiteScript (versions 3.x and higher) attempting to load it.

Examples

In the following example, a 2.0 Client Script module is documented.

/**
 * A sample Client script module
 *
 * @NApiVersion 2.x
 * @NModuleScope Public
 * @NScriptType ClientScript
 */
define(["N/search"], function (s) {

    var exports = {};
    // ...

@NModuleScope

Syntax

@NModuleScope <scope>

scope can be any of:

  • SameAccount
  • TargetAccount
  • Public

Overview

The @NModuleScope tag is used to document the access level of a SuiteScript module.

  • If the value is set to SameAccount, access to the module is limited to other modules from the same bundle, and modules native to the same source account or sandbox environment. Source code is not hidden at runtime.
  • If the value is set to TargetAccount, access to the module is limited to other modules from the same bundle, and modules native to the same source account, target account, or sandbox environment. Source code is hidden at runtime.
  • If the value is set to Public, any script in the account can load and use the module. Source code is hidden at runtime.

Examples

In the following example, a 2.0 Client Script module is documented such that it is only visible to modules native to the same account.

/**
 * A sample Client script module only visible to the same account or sandbox
 *
 * @NApiVersion 2.0
 * @NModuleScope SameAccount
 * @NScriptType ClientScript
 */
define(["N/search"], function (s) {

    var exports = {};
    // ...

@NScriptType

Syntax

@NScriptType <scriptType>

scriptType can be any of:

  • BundleInstallationScript
  • ClientScript
  • MapReduceScript
  • MassUpdateScript
  • Portlet
  • Restlet
  • ScheduledScript
  • Suitelet
  • UserEventScript
  • WorkflowActionScript

Overview

The @NScriptType tag is used to document the type of Script record a SuiteScript module represents.

Examples

In the following example, a 2.0 Client Script module is documented.

/**
 * A sample Client script module only visible to the same account or sandbox
 *
 * @NApiVersion 2.X
 * @NModuleScope TargetAccount
 * @NScriptType ClientScript
 */
define(["N/search"], function (s) {

    var exports = {};
    // ...