Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@sasjs/sas-language

Latest version: v0.8.0

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
npm package Publisher: allanbowe, krishna-acondy, yury_shkoda
1 Stars
0 Forks
13 Versions
13.2K Downloads
JavaScript Repo language

Scan summary

@sasjs/sas-language was last scanned on 24 Nov 2026 at version 0.8.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 13 versions; the latest 2 were published within 6 days (19–24 Nov 2026).
  • Findings: No rules fired in version 0.8.0.
  • Downloads: 13,223 downloads.

Versions

13 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.8.0 LATEST 24 Nov 2026 No rules fired
0.7.4 19 Nov 2026 No rules fired
0.7.3 17 Nov 2026 No rules fired
0.7.2 16 Nov 2026 Not shown
0.7.1 16 Nov 2026 Not shown

No rules fired in 0.8.0

Findings

Findings for v0.8.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.8.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

SAS language support for editors

@sasjs/sas-language provides SAS language support in two forms:

data/      the vocabulary: completions, hover documentation, signatures
server/    the SAS language server, compiled from upstream source

Both are resolved from the SAS extension for Visual Studio Code and refreshed on a schedule, so this package owns the language support rather than depending on an installed editor extension.

The data is small, has no runtime dependencies and uses no Node built-ins, so it runs unchanged in a browser, in Node and in an editor extension. The server is the full language service - semantic tokens, diagnostics, context-aware completions - and is what an editor that wants a real parser loads.

Why this exists

An editor needs to know SAS. The alternatives were to depend on an installed extension for the data, or to hand-maintain keyword lists. This package takes the authoritative data, transforms it into something cheap to load, and keeps it current with a scheduled job.

The server is here for the same reason. Upstream publishes no built artifact - its dist/ is ignored and it has no release assets - so anyone wanting the language service had to build it from source themselves. This package compiles it from the pinned commit and ships the result.

Install

npm install @sasjs/sas-language

The registry tarball ships the compiled output, so nothing is built on install. It is 12 MB compressed and 5,214 files, carrying the data and both language-server builds.

A git install also works, but needs lifecycle scripts enabled, because the build output is not committed and prepare compiles it. A git install does not build the server, which takes a few minutes - run npm run build:server for that.

npm install git+https://github.com/sasjs/sas-language.git#<commit>

Note that npm rewrites a github git dependency to an ssh URL in the lockfile, which a CI without an ssh key cannot fetch, so prefer the registry.

Use

The data is split so that a completion provider loads something small and hover text is fetched only when the user actually hovers.

data/<group>.index.json    completion index, ~76 KB across all groups
data/<group>.docs.json     hover documentation, ~1.2 MB across all groups
import functionsIndex from '@sasjs/sas-language/data/functions.index.json'
import { completionItems, docsFor, groupDocsPath } from '@sasjs/sas-language'

// Eager: completion items, ready for monaco.languages.registerCompletionItemProvider
const items = completionItems(functionsIndex)
// [{ label: 'ABS', kind: 1, detail: 'SAS function (SAS_FUNCTION)', insertText: 'ABS' }, ...]

// Lazy: the documentation only when a hover happens
const docs = await fetch(groupDocsPath('functions')).then((r) => r.json())
const doc = docsFor(docs, 'abs')
// { help: 'Returns the absolute value. ...' }

Every group is a separate path, so a bundler emits only the groups you import and the documentation as its own chunk.

Function snippets

Import the VS Code snippet JSON directly in an editor or bundler:

import functions from '@sasjs/sas-language/snippets/functions.json'

Each named entry has a prefix, a body array of snippet strings (including placeholders), and a description. These 223 function templates are distinct from the completion index above and are not updated by the data refresh. Node ESM requires a JSON import attribute (with { type: 'json' }); CommonJS can use require.

Formatting

./format exposes the formatter the server uses, without running the server - the reprint as a call, for hosts that cannot speak LSP to it, such as a CLI in CI.

It has two builds behind one specifier. In node it reads the vocabulary from disk (below). A bundler that honours the browser condition gets dist/format.browser.bundle.js instead, which fetches the same files from a URL: the core set goes up front, and anything else the lexer asks for (a PROC step's procedure file, a vocabulary file from data/) is fetched on the miss and formatted again, so a program costs a handful of requests once and none afterwards. dataRoot is a URL there, defaulting to /sas-language/, and a failed fetch rejects rather than returning the buffer unchanged: a 404 names the file and the status, and a host that does not answer within fetchTimeoutMs (30000 by default, and an option on the call) is aborted, with the rejection naming the URL and the option. Formats run one at a time, so a stalled root costs its own call and not the ones behind it. TypeScript sees that signature too when the consumer's tsconfig names the condition ("customConditions": ["browser"], which is what a bundler taking the browser build has to do anyway): fetchTimeoutMs is then accepted and dataRoot is documented as a URL.

import { formatText } from '@sasjs/sas-language/format'

const formatted = await formatText(source, { tabWidth: 2, useTabs: false, keywordCase: 'lower' })

It lexes with the same vocabulary the server does, so it needs that data tree on disk. dataRoot defaults to the staged server/node directory, which a registry install already has; pass it to read the vocabulary from somewhere else. It applies to that call alone: the hook the lexer reads through is process-wide, so each call sets it before lexing and restores it afterwards. The root must be the complete tree: with the procedure files missing, a DATA step still formats and a PROC step throws, naming the file it could not read. The vocabulary is cached for the life of the process, so a root decides where a file is read the first time it is needed.

Keyword case is preserved unless you ask for a case: keywordCase: 'upper' | 'lower' rewrites the words the lexer marks as keywords - including else/then and the statements inside a procedure - and leaves strings, comments and identifiers alone. A name the lexer cannot tell from a keyword, such as a DATA step variable called label, is cased with it; that is inherent to matching words rather than parsing them, and SAS is case-insensitive about it.

The language server

Two builds ship, because the two consumers run in different places:

server/browser/server.js            webworker build, for an editor in a browser
server/node/dist/node/server.js     node build, run over IPC by a VS Code extension

The browser build is a single file: it inlines everything. The node build is a directory tree, because it reads parts of itself from disk at runtime - the formatter's impl/ modules, the Python typeshed stubs, the SAS documentation tree and the localised message bundles. The staged layout mirrors the depth the upstream build produces (server/node/dist/node/), so every relative path the bundle computes resolves inside the package.

The server has to exist as a file on disk - a VS Code extension spawns it as a child process rather than importing it - so copy the whole node tree out of the package at build time, preserving its internal layout:

const serverModule = context.asAbsolutePath('out/server/dist/node/server.js')

const serverOptions: ServerOptions = {
  run: { module: serverModule, transport: TransportKind.ipc }
}
const clientOptions: LanguageClientOptions = {
  documentSelector: [{ language: 'sas' }]
}

new LanguageClient('sas-lsp', 'SAS', serverOptions, clientOptions).start()

server/provenance.json records the commit both builds came from. It also records byteReproducible: false: the upstream loader inlines the Python stubs in filesystem order rather than sorting them, so the artifact is deterministic in content but not in bytes.

Groups

GROUPS lists every group with its label, completion kind and entry count. Group names are stable; entries are refreshed from upstream.

group contents
statements global, procedure and DATA step statements
procNames procedures
functions SAS functions
callRoutines CALL routines
macroStatements macro statements
macroFunctions macro functions, autocall and ARM macros
formats, informats formats and informats
options data set options
systemOptions system options
odsTagsets ODS destinations
styleElements, styleAttributes, styleLocations ODS style parts
sqlKeywords PROC SQL keywords
whereOperators WHERE operators
automaticVariables automatic variables
macroDefinitionOptions macro definition options
hashMethods hash package methods
statisticsKeywords statistics keywords
ds2Keywords, ds2Functions DS2 language
API
export purpose
GROUPS the group catalogue: name, label, completion kind, counts
toEntries(index) unpacks a group's index into { name, type, takesValue }
words(index) every word in a group, for matching
completionItems(index) completion items, inserting the trailing = for value options
docsFor(docs, name) one word's documentation, case-insensitively
groupIndexPath(group) the package path of a group's index
groupDocsPath(group) the package path of a group's documentation
UPSTREAM_REF, UPSTREAM_SOURCE which upstream commit the data came from

How the data is refreshed

npm run refresh fetches the upstream files at a pinned commit and rebuilds. The scheduled workflow in .github/workflows/refresh.yml runs this weekly and opens a pull request when the data changes, so an upstream change is reviewed rather than absorbed silently.

provenance.json records the upstream repository, the resolved commit, and a sha256 per generated file. Tests assert the published data matches those hashes, which means hand-edited data or a stale .upstream/ fails the build.

The build fails when upstream changes the shape of a file, rather than publishing a quietly empty group. That is deliberate: a shape change should break a build, not degrade somebody's editor.

npm run fetch     # download at the latest upstream commit
npm run build     # transform into data/ and compile
npm test          # validate the data and the transforms

The server is compiled from the same pin, by npm run build:server. That step is heavier - it fetches upstream at the commit, installs its dependencies and runs its build - so it is deliberately not part of npm run build. It runs in CI when the build or the pin changes, weekly against the latest upstream, and before any publish.

Repository hardening

.npmrc installs without running lifecycle scripts, writes exact versions, enforces the engines field, and keeps the lockfile honest.

.git-hooks/ carries the org's checks: a pre-commit that scans the staged diff with gitleaks and refuses a commit over 2MB, and a commit-msg that enforces Conventional Commits. npm run prepare wires them up, but .npmrc sets ignore-scripts=true, which suppresses it - so after a fresh clone:

git config core.hooksPath ./.git-hooks

A hook is best-effort, so CI enforces the same things from the other side: a full-history gitleaks detect and npm audit --audit-level=low across every dependency, dev included. The package has no runtime dependencies, so any advisory at all is a real one.

Releasing

.github/workflows/publish.yml publishes on every push to main, and the version comes from the conventional commits since the last tag - fix: and feat: on main release, chore: and ci: do not.

@sasjs/release cuts the tag and a draft release over the API: nothing is pushed to main, no version commit is made, and no branch protection is bypassed. --prepare-publish then stamps the tag's version into package.json and refuses a tag that is not an ancestor of main, and the tarball is published with the npm trusted publisher, so no token is stored anywhere. The release is un-drafted last, so a version is never advertised before its artifact exists.

Between the build and the publish sit the gates that decide whether a release is real: npm run build:ship builds everything in one command, npm test runs afterwards so the suites that need those artifacts actually execute, and npm run verify:pack derives every path the export map promises and refuses to publish a tarball missing one. package.json on main keeps its committed version - the tag records what was released.

Setup, once: on npmjs.com, add a trusted publisher for @sasjs/sas-language - repository sasjs/sas-language, workflow publish.yml, environment blank. The filename is load-bearing: the trusted publisher and the provenance attestation both name it.

Licence

The package is MIT. Both the data and the compiled server come from the SAS extension for Visual Studio Code, which is Apache-2.0. The server also carries pyright (MIT), typeshed (Apache-2.0), buffer (MIT) and ieee754 (BSD-3-Clause); the licence texts travel with it in server/. See NOTICE.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @sasjs/sas-language

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Vulnerability Insights

The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229