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

newo-dsl-analyzer

v1.0.0

Published

Core static-analysis engine for the Newo DSL (NSL/Guidance). Parser, diagnostics, rules, formatter, plugin loader. Consumed by newo-dsl-lsp, the newo CLI, and third-party tooling.

Downloads

80

Readme

newo-dsl-analyzer

Static-analysis engine for the Newo DSL (NSL / Guidance / Jinja). This is the shared engine consumed by the newo CLI (newo lint, newo format, newo check) and the newo-dsl-lsp language server.

npm

Install

npm install newo-dsl-analyzer

Public API

High-level: createLinter

import { createLinter } from 'newo-dsl-analyzer';

const linter = createLinter({
  // Optional. Defaults to 'bundled' (platform actions + builtins).
  schemas: 'bundled',
  // Optional. Override rule severity.
  rules: { W101: 'off' },
  // Optional. Load plugins.
  plugins: [],
});

// Lint a single in-memory source.
const result = linter.lint(source, '/abs/path/file.jinja');
console.log(result.diagnostics);
// [{ severity: 'warning', code: 'W101', message: 'Unknown function: Foo', range: {...} }]

// Lint a project tree.
const report = linter.lintProject('/abs/path/to/project', {
  extensions: ['.jinja', '.guidance', '.nsl', '.nslg'],
  ignore: ['/abs/path/to/project/archived'],
});
console.log(report.errorCount, report.warningCount);

// Introspect rules.
linter.listRules().forEach(r => console.log(r.id, r.meta?.title));

High-level: createFormatter

import { createFormatter } from 'newo-dsl-analyzer';

const formatter = createFormatter({ indent: 2, insertFinalNewline: true });
const { formatted, changed } = formatter.format(source, filePath);
if (changed) await fs.writeFile(filePath, formatted);

Config loading: loadConfig

import { loadConfig } from 'newo-dsl-analyzer';

// Walks up from cwd looking for .neworc.yaml / .neworc.yml / .neworc.json
const config = loadConfig(process.cwd());
// { rules?: { [ruleId]: 'off' | 'warning' | 'error' }, plugins?: string[], ignore?: string[] }

Low-level: NewoDslAnalyzer

The LSP server consumes this directly for completions / hover / go-to-definition. Most users should prefer createLinter.

import { NewoDslAnalyzer } from 'newo-dsl-analyzer';

const analyzer = new NewoDslAnalyzer();
analyzer.loadSchemas();       // bundled schemas
// or:
analyzer.loadSchemas('/path/to/schemas');   // directory with *.schema.yaml files
// or:
analyzer.loadInlineSchemas({                 // programmatic, e.g. from NEWO API
  skills: [...],
  actions: [...],
  attributes: [...],
  events: [...],
});

const result = analyzer.parseTemplate(source, filePath);
const diagnostics = analyzer.getDiagnostics(source, filePath);
const completions = analyzer.getCompletions(source, filePath, line, column);
const hover = analyzer.getHover(source, filePath, line, column);
const definition = analyzer.getDefinition(source, filePath, line, column);

Schemas

The analyzer needs a catalog of known skills / actions / attributes / events to validate references. There are three ways to supply it:

| Source | When | How | |--------|------|-----| | Bundled (default) | You want zero setup and only need platform-level ACTIONS + Jinja builtins validated. | createLinter() with default schemas: 'bundled'. | | Directory | You have generated YAML files from your NEWO account and want offline linting with your full catalog. | createLinter({ schemas: { kind: 'dir', path: '/path/to/schemas' } }). Files must match *.schema.yaml names. | | Inline | You want to inject live API data (typical for newo lint --live). | createLinter({ schemas: { kind: 'inline', skills, actions, attributes, events } }). |

To generate customer-specific schemas, see newo-dsl-spec-generator (internal tool) or run newo lint --live from the newo CLI to cache your account's current catalog into .newo/{customer}/actions.json.

Diagnostic codes

| Code | Severity | Description | |------|----------|-------------| | E001 | error | Unbalanced expression braces {{ }} | | E002 | error | Unbalanced statement braces {% %} | | E003 | error | Unbalanced comment braces {# #} | | E010-E012 | error | Guidance block mismatch (unclosed / misnamed {{#name}} {{/name}}) | | E100 | error | Unknown skill (not in registered catalog) | | E101 | error | Required skill parameter missing | | W001 | warning | Style: missing whitespace in control structures | | W010 | warning | Unknown Guidance block name | | W100 | warning | Unknown Jinja builtin | | W101 | warning | Unknown function (not a skill or builtin, excluded from common utility prefixes) | | W102 | warning | Unknown parameter name for a known function | | W103 | warning | Unknown customer attribute |

Disable rules in .neworc.yaml:

rules:
  W101: off
  W102: warning
  E100: error

Types

All type exports are re-exported from newo-dsl-core for plugin authors. You do not need to install newo-dsl-core separately - importing from newo-dsl-analyzer works for both runtime and types.

License

Proprietary - Newo AI. All rights reserved.