A language for NetSuite · compiles to SuiteScript 2.1

SuiteScript, without the SuiteScript.

Mynt knows your records, checks your fields, and infers your modules before it emits a line of SuiteScript. One file is one script. Nothing to wire.

Read on npm
lookup.mn source
01

Say what you mean.
Ship SuiteScript.

Every Mynt file compiles to plain, readable SuiteScript 2.1 that you can deploy as-is. The entry point decides the script type. The things you touch decide the modules. Nothing below is hand-written.

hook.mn
hook.js
02

The platform is in the type system.

Records are types.

Customer and SalesOrder are compile-time symbols from your schema, not strings you hope are spelled right.

let customer = load Customer(123)
record Customer record.Type.CUSTOMER · 3 fields commentsemailentityid read-only

Mistakes fail at compile time.

Writing to a record that NetSuite has already saved is an error, not a silent no-op you find in production three weeks later.

afterSubmit (customer: Customer) {
    customer.comments = "Too late"
}
error MYNT1007 Cannot assign Customer.comments in afterSubmit: the Customer is already saved and the change would be silently discarded. Use beforeSubmit instead.

Modules are inferred.

Use log, get N/log. Use load, get N/record. The define block is written from what you actually called, never from a scan of your text.

log.audit("Customer saved")
let order = load SalesOrder(42)
for row in query Customer { }
define(["N/log", "N/query", "N/record"], …

Persistence is analysed.

The compiler follows every path through your script. A change that can reach the end without a save gets a warning, at the line that made it.

customer.comments = "Changed"
if customer.email === "" {
    save customer
}
warning MYNT2001 'customer' may leave this script with unsaved changes: it is modified here, but not every execution path that follows performs 'save customer'

Less ceremony. Clearer intent.

Mynt is a small language on purpose. Statements end at newlines. Conditions are Bool or they are errors. Records you load are yours to save; records NetSuite hands you are not. The rules are few, and the compiler enforces all of them.

03

One command,
no build pipeline.

  • mynt check Diagnostics with code frames. Exit non-zero on errors, so it slots into CI.
  • mynt build Writes the .js next to your .mn. Deploy it like any SuiteScript file.
  • mynt schema pull Snapshots your account's records and fields into the repo. The compiler never touches the network.
  • language server Hover, completion, references, and rename for records, fields, and locals.
~/netsuite/scripts

            

v0. An experimental spike, published early.

Mynt today covers user event and scheduled scripts: records, fields, sublists, queries, functions, and the persistence rules around them. The built-in schema knows a handful of standard records; mynt schema pull teaches it yours. Everything on this page compiles with the published package.