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

@3dsource/data-loader

v0.0.36

Published

Data loader for Angular + CLI Drive parser

Readme

@3dsource/data-loader

Schema-driven data loading for Angular applications, plus a Node.js CLI for converting Google Sheets data into local CSV/JSON assets.

What it provides

  • DataLoaderService, a root-provided Angular service
  • CSV, JSON, object and language parsers selected by a JSON schema
  • one generated loader method per parser id
  • drive-parser, a CLI that reads Google Sheets and writes generated assets

The package does not expose an NgModule and does not implement generic binary asset loading, caching, progress events or batch-download APIs.

Requirements

  • Node.js 20 or newer for the CLI and repository tooling
  • Angular >=19.0.0 <23.0.0
  • @3dsource/utils ^1.0.21

Installation

npm install @3dsource/data-loader @3dsource/utils

Angular itself is a peer dependency and is normally already present in the application.

Angular usage

The service loads a schema, creates an API method for every enabled parser and then loads each parser's default asset from:

<document-root>/assets/data/<id>/<subId?>.<extension>

Without subId, the path is <document-root>/assets/data/<id>.<extension>. The default extension is .json.

import { Component, inject } from '@angular/core';
import { DataLoaderService } from '@3dsource/data-loader';

@Component({
  selector: 'app-data-consumer',
  template: '',
})
export class DataConsumerComponent {
  private readonly dataLoader = inject(DataLoaderService);
  readonly loadedData: Record<string, unknown> = {};

  async load(): Promise<void> {
    await this.dataLoader.initialize('/assets/data/app.data-schema.json', this.loadedData);

    console.log(this.loadedData['products']);
  }
}

An application can override a parser's default URL or provide inline data through the global appReady hook. Its API contains one method per schema parser id:

interface DataLoaderApi {
  products: (urlOrData: unknown) => Promise<unknown>;
}

const globalScope = globalThis as typeof globalThis & {
  appReady?: (loader: DataLoaderApi) => void;
};

globalScope.appReady = (loader) => {
  void loader.products('/assets/custom/products.json');
};

Set appReady before calling initialize(). A parser started from this hook is not loaded again from its default URL.

DataLoaderService is root-provided and keeps parser promises between calls; treat initialize() as a one-time application bootstrap operation. It resolves only after every enabled parser returns a truthy result. Source and parse errors are logged internally, so applications that load remote data should race initialization against their own timeout if they need a visible failure state.

Schema

The package contains schema.json, which can be referenced by editors and validation tools. A minimal schema looks like this:

{
  "$schema": "./node_modules/@3dsource/data-loader/schema.json",
  "version": "1.0",
  "description": "Application data",
  "path": "data/",
  "parsers": [
    {
      "id": "products",
      "save": true,
      "load": true,
      "processor": {
        "callBack": "JsonParser",
        "extension": ".json",
        "arguments": {
          "rowAsHead": 0,
          "splitBy": []
        }
      }
    }
  ]
}

Supported processor.callBack values are:

  • CSVParser
  • JsonParser
  • ObjectParser
  • LanguageParser

Set load to false to exclude a parser from Angular loading. The save, sheetId, googleDoc and processor.saveFunction fields are primarily used by the CLI.

Drive parser CLI

After installing the published package:

drive-parser <google-doc-config.json> <schema.json> <output-directory>
drive-parser --help

The Google Doc config must contain a GoogleDoc URL prefix. For every schema parser whose save value is not false, the CLI appends sheetId (or id), parses the response and writes it under the output directory.

Pass the output directory with a trailing path separator because the CLI concatenates it with each generated filename, for example:

drive-parser ./GoogleDoc.json ./app.data-schema.json ./src/assets/data/

Repository development

Run these commands from the repository root:

pnpm --filter @3dsource/data-loader build
pnpm --filter @3dsource/data-loader typecheck:node
pnpm --filter @3dsource/data-loader clean

The package test script exercises the built CLI against repository fixtures, so build the package first and expect it to access the configured Google Sheet:

pnpm --filter @3dsource/data-loader build
pnpm --filter @3dsource/data-loader test

To version and publish the package, use the verified root release flow:

pnpm release:package -- data-loader patch latest

The release command publishes to npm; it is not a version-only command. It checks only data-loader and its local workspace dependency @3dsource/utils; unrelated libraries and the demo are not built or tested.

See the live example in projects/demo/src/app/demo-layout/info-pages/data-loader/.