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

xrmfastdev-client

v0.1.0

Published

Xrm API abstraction layer with adapters for PCF, Web Resources, and local development proxy

Readme

xrmfastdev-client

Adapter-pattern abstraction over the Xrm / Dataverse WebApi. Write your data access once and run it unchanged in a deployed web resource, a PCF control, or locally against a proxy — you only swap the adapter at startup.

Part of XRM Fast Dev. Zero runtime dependencies.

Install

npm install xrmfastdev-client

Usage

import { initializeXrm, getXrm, GlobalXrmAdapter } from 'xrmfastdev-client';

// Call once at app startup
initializeXrm(new GlobalXrmAdapter());

// Use anywhere
const xrm = getXrm();
const record = await xrm.webApi.retrieveRecord('contact', contactId, '?$select=fullname');

Adapters

| Adapter | Use case | Backed by | |---------|----------|-----------| | GlobalXrmAdapter | Deployed web resources | window.Xrm.WebApi | | PcfXrmAdapter | PCF controls | context.webAPI | | ProxyXrmAdapter | Local development | WebSocket → xrmfastdev |

Web resource

initializeXrm(new GlobalXrmAdapter());

PCF control

public init(context: ComponentFramework.Context<IInputs>) {
  initializeXrm(new PcfXrmAdapter(context));
}

public updateView(context: ComponentFramework.Context<IInputs>) {
  (getXrm() as PcfXrmAdapter).updateContext(context);
}

Local development

initializeXrm(new ProxyXrmAdapter({
  proxyUrl: 'ws://localhost:8080',
  connectTimeout: 5000,   // optional, default 5000ms
  requestTimeout: 30000,  // optional, default 30000ms
}));

Environment switch

if (import.meta.env.DEV) {
  initializeXrm(new ProxyXrmAdapter({ proxyUrl: 'ws://localhost:8080' }));
} else {
  initializeXrm(new GlobalXrmAdapter());
}
// Same business logic works everywhere:
const accounts = await getXrm().webApi.retrieveMultipleRecords('account', '?$top=10');

API

Provider functions

initializeXrm(adapter: IXrmContext): void   // set the active adapter (once)
getXrm(): IXrmContext                        // get it anywhere (throws if not initialized)
isXrmInitialized(): boolean                  // has it been set?
resetXrm(): void                             // clear it (mainly for tests)

IXrmWebApi

retrieveRecord(entityLogicalName, id, options?): Promise<unknown>
retrieveMultipleRecords(entityLogicalName, options?, maxPageSize?): Promise<RetrieveMultipleResult>
createRecord(entityLogicalName, data): Promise<{ id: string }>
updateRecord(entityLogicalName, id, data): Promise<void>
deleteRecord(entityLogicalName, id): Promise<void>

getXrm() also exposes userSettings and organizationSettings.

Entity names: Model-Driven / PCF use the singular logical name (account); the Portal proxy path expects the plural set name (accounts).

License

MIT © Albert Halchanskyi