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

@reso-standards/reso-metadata-utils

v0.1.2

Published

RESO OData metadata processing utilities — CSDL parse, validate (CSDL/XSD), serialize (EDMX → report), and metadata fetching. The deps-requiring side of the RESO metadata split; sibling to reso-common's zero-dep model.

Readme

@reso-standards/reso-metadata-utils

RESO OData metadata processing utilities: CSDL parsing, validation, EDMX → metadata-report serialization, and live metadata fetching. This is the dependency-requiring side of the RESO metadata split (reso-tools #221) – a sibling to @reso-standards/reso-common, which holds the zero-dependency metadata model and EDMX generation. Nothing here imports reso-common; the two are meant to be used together.

Its one runtime dependency is fast-xml-parser.

Install

npm install @reso-standards/reso-metadata-utils

Or work from the reso-tools monorepo:

git clone https://github.com/RESOStandards/reso-tools.git
cd reso-tools && npm install

What It Does

Four capabilities, all exported from the package root.

1. Parse and Inspect CSDL

Turn an OData 4.01 $metadata (CSDL/EDMX) document into a typed CsdlSchema, then walk it.

import { parseCsdlXml, discoverResources, getFieldsForResource } from '@reso-standards/reso-metadata-utils';

const schema = parseCsdlXml(edmxXml);
const resources = discoverResources(schema);                    // ReadonlyArray<CsdlResourceInfo>
const propertyFields = getFieldsForResource(schema, 'Property'); // ReadonlyArray<FieldInfo>

| Export | Purpose | |--------|---------| | parseCsdlXml(xml) | CSDL/EDMX XML → typed CsdlSchema | | discoverResources(schema) | Entity sets exposed as resources | | getEntityType / getEnumType / getComplexType | Look up a named type | | getFieldsForResource(schema, name) / getFieldsForEntityType / getAllFields | Field enumeration |

2. Validate CSDL

import { validateCsdl } from '@reso-standards/reso-metadata-utils';

const result = validateCsdl(schema, '4.01'); // CsdlValidationResult; odataVersion defaults to '4.0'
if (!result.valid) console.error(result.errors);

XSD validation lands later under a Node-only subpath.

3. Serialize to a Metadata Report

Produce the canonical RESO metadata-report.json shape from EDMX XML or an already-parsed schema.

import { generateMetadataReport, serializeMetadataReport } from '@reso-standards/reso-metadata-utils';

const report = generateMetadataReport(edmxXml, '2.1');  // MetadataReport — parse + serialize in one call
const report2 = serializeMetadataReport(schema, '2.1'); // MetadataReport — from a parsed CsdlSchema

4. Fetch metadata from a live server

import { fetchAndParseMetadata, fetchRawMetadataWithVersion } from '@reso-standards/reso-metadata-utils';

const schema = await fetchAndParseMetadata(baseUrl, token);              // CsdlSchema
const { xml, version } = await fetchRawMetadataWithVersion(baseUrl, token);

| Export | Purpose | |--------|---------| | fetchRawMetadata(baseUrl, token, opts?) | Raw $metadata XML | | fetchRawMetadataWithVersion(baseUrl, token, opts?) | XML plus the detected DD version | | fetchAndParseMetadata(baseUrl, token, opts?) | Fetch and parse to CsdlSchema |

Fetch failures throw MetadataFetchError.

Types

The package ships full TypeScript declarations: the Csdl* model (CsdlSchema, CsdlEntityType, CsdlProperty, CsdlEnumType, …), the MetadataReport* report shapes, and FieldInfo / FieldAnnotation.

Development

npm install
npm run build
npm test

License

See LICENSE – the RESO End-user License Agreement.