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

@neverblink/linkml

v0.15.1

Published

A Scala 3 cross-platform library and CLI for LinkML schema validation and multi-format code generation (Scala, JSON Schema, SHACL, RDFS)

Readme

@neverblink/linkml

JavaScript / TypeScript bindings for LinkML-Scala – LinkML schema validation and multi-format code generation (JSON Schema, SHACL, RDFS, Scala), compiled from Scala 3 to JavaScript via Scala.js.

The package ships a single self-contained ES module. It has no runtime dependencies.

Installation

npm install @neverblink/linkml

Usage

import { LinkML } from "@neverblink/linkml";

const schema = `
id: https://example.org/my-schema
name: my-schema
prefixes:
  linkml: https://w3id.org/linkml/
imports:
  - linkml:types
default_range: string
classes:
  Person:
    tree_root: true
    attributes:
      name:
      age:
        range: integer
`;

// Parse the schema once into a reusable handle. The second argument 
// is an import map (filename -> YAML source) for any models referenced
// via LinkML \`imports:\`. Pass {} when there are none.
const { view, report } = LinkML.loadFromString(schema, {});
if (!view) throw new Error(JSON.stringify(report, null, 2)); // fatal problems: nothing to generate from

// Then run any generator against the loaded schema.
const jsonSchema = LinkML.jsonSchema(view);
console.log(jsonSchema);

const shacl = LinkML.shacl(view);
console.log(shacl);

Loading

There are two ways to load a schema into a SchemaView handle:

  • loadFromString(schema, importMap) – start from the schema's YAML text. Imported models must be provided in the import map (filename → YAML).
  • loadFromPath(path, importMap) – start from a path into the import map. The root schema is read from importMap[path] (paths behave like file paths, .yaml is appended when missing). Because the root is tracked from the start of import resolution, this variant is immune to cyclic imports that reference the root schema back.
// loadFromPath: the root lives in the import map under its own path.
const { view } = LinkML.loadFromPath("model.yaml", {
  "model.yaml": schema,
  "person.yaml": personSchema, // referenced via `imports: - person`
});

Available functions

Load a schema into a SchemaView handle (see above), then pass that handle to any generator:

| Function | Returns | Notes | |----------------------------------------------------------------------| --- |--------------------------------------------------------------| | loadFromString(schema, importMap, inferMessages?) | LoadResult | parse from YAML text; { view?, report } | | loadFromPath(path, importMap, inferMessages?) | LoadResult | parse from a path in the import map; cycle-safe for the root | | jsonSchema(view, open?, treeRootOverride?) | string | JSON Schema | | shacl(view, open?, onlyClassesFromRootSchema?, format?) | string | SHACL shapes, ttl (default) or nt | | rdfs(view, onlyClassesFromRootSchema?, format?) | string | RDFS, ttl (default) or nt | | linkml(view, pruningMode?, skipDerivation?, treeRoot?, outFormat?) | string | derived/pruned LinkML schema | | scala(view, packageName) | Record<string, string> | filename → generated Scala | | frictionless(view, pruningMode?, treeRoot?, skipClassesWithoutIdentifier?) | Record<string, string> | filename → Frictionless data package (datapackage.json and schemas/*.json) | | graphQl(view, pruningMode?, treeRoot?) | string | GraphQL | | erDiagram(view, pruningMode?, treeRoot?, optionalMarker?) | string | Mermaid entity relationship diagram | | lint(view, inferMessages?) | object | SchemaValidationReport (JSON) | | buildInfo() | object | BuildInfo (JSON) – version and build metadata |

See index.d.ts for full type signatures.

Browser use

The module works in Node.js as-is. In the browser it references process.cwd once, so provide a minimal shim before importing:

<script>
  var process = { cwd: () => "/" };
</script>

License

Apache-2.0 © NeverBlink