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

@tenonhq/sincronia-schema

v0.0.5

Published

ServiceNow table schema fetcher and organizer for Sincronia

Downloads

594

Readme

@tenonhq/sincronia-schema

ServiceNow table schema fetcher and organizer for Sincronia. Reads scopes from your sinc.config.js and fetches all custom table definitions for those scopes from your ServiceNow instance.

Usage via Sincronia CLI

# Fetch schemas for all scopes defined in sinc.config.js
sinc schema pull

# Fetch schema for a single scope
sinc schema pull --scope x_cadso_work

# Custom output directory
sinc schema pull --output ./tables

Requires SN_INSTANCE, SN_USER, and SN_PASSWORD in your .env file.

Scopes are read from the scopes object in your sinc.config.js:

module.exports = {
  // ...
  scopes: {
    x_cadso_work: { sourceDirectory: "src/x_cadso_work" },
    x_cadso_core: { sourceDirectory: "src/x_cadso_core" },
    // Add more scopes here — they will be picked up automatically
  },
};

Usage as Library

import { pullSchema, fetchSchema, organizeSchema } from "@tenonhq/sincronia-schema";

// Full pipeline: fetch + organize
const index = await pullSchema({
  instance: "your-instance.service-now.com",
  username: "admin",
  password: "password",
  outputDir: "./schema",
  scopes: ["x_cadso_work", "x_cadso_core"],
});

// Or step-by-step
const schema = await fetchSchema({
  instance: "your-instance.service-now.com",
  username: "admin",
  password: "password",
  outputDir: "./schema",
  scopes: ["x_cadso_work"],
});

const index = await organizeSchema({
  schema,
  outputDir: "./schema",
  instance: "your-instance.service-now.com",
  scopes: ["x_cadso_work"],
});

Output Structure

schema/
├── index.json              # Master index of all tables and scopes
├── work/                   # Tables from x_cadso_work scope
│   ├── _summary.json
│   ├── x_cadso_work_project.json
│   └── ...
├── core/                   # Tables from x_cadso_core scope
│   ├── _summary.json
│   └── ...
└── sinc/                   # Tables from x_nuvo_sinc scope
    └── ...

Application directory names are derived from scope names by stripping the vendor prefix (x_{vendor}_).

Table Schema Format

Each table JSON file contains:

{
  "table_name": "x_cadso_work_project",
  "label": "Project",
  "scope": "x_cadso_work",
  "parent": "task",
  "hierarchy": ["x_cadso_work_project", "task"],
  "created_at": "2025-08-10T04:28:39.043Z",
  "field_count": 113,
  "fields": [
    {
      "name": "short_description",
      "label": "Short description",
      "type": "string",
      "max_length": "160",
      "mandatory": false,
      "reference": "",
      "default_value": "",
      "inherited_from": "task"
    }
  ]
}

Index Format

The index.json master index includes the scopes that were fetched:

{
  "instance": "your-instance.service-now.com",
  "generated_at": "2025-08-10T04:28:39.043Z",
  "total_tables": 131,
  "scopes": ["x_cadso_work", "x_cadso_core", "x_nuvo_sinc"],
  "applications": [
    {
      "name": "work",
      "table_count": 38,
      "tables": ["x_cadso_work_project", "x_cadso_work_task"]
    }
  ]
}