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

frappe-js-client

v3.4.0

Published

Zero-dependency, fetch-native TypeScript/JavaScript client for Frappe Framework REST APIs (v14, v15, v16).

Readme

Frappe JS Client

npm version License: MIT TypeScript docs

Zero-dependency TypeScript/JavaScript client for Frappe Framework REST APIs. Uses globalThis.fetch.

Supports Frappe v14, v15, and v16. Default apiVersion is 2 (/api/v2, Frappe 15+). Pass { apiVersion: 1 } for classic /api/method + /api/resource — that is the v14-safe path, and it also works on v15 and v16.

Realtime is optional: frappe-js-client/realtime with peer socket.io-client. Core stays zero-dependency.

Docs: dhiashalabi.github.io/frappe-js-client

Installation

pnpm add frappe-js-client
# or
npm install frappe-js-client

No runtime dependencies.

Quick start

import { createFrappeClient, tokenAuth, consoleLogger } from 'frappe-js-client'

const frappe = createFrappeClient({
    url: 'https://frappe.example.com',
    auth: tokenAuth({ apiKey: '...', apiSecret: '...' }),
    logger: consoleLogger(), // optional; pathname only, no query/headers/bodies
})

const user = await frappe.db.getDoc('User', 'Administrator')

Session login (classic /api/method/login):

await frappe.auth.login({
    username: 'admin',
    password: 'password',
})

Extended modules (permission, workflow, report, desk, site):

import { withExtended } from 'frappe-js-client/extended'

const app = withExtended(frappe)
await app.workflow.apply(doc, 'Approve')

Realtime (optional peer socket.io-client):

import { createRealtime } from 'frappe-js-client/realtime'

const realtime = createRealtime(app)
realtime.subscribeDoc('ToDo', 'TD-1', (event) => console.log(event))

Full guides: documentation. API reference: Client API · Codegen.

Development

Requires pnpm 11 and Node.js 20+ (CI uses Node 22).

This package lives in a pnpm workspace. Clone the repo root, not packages/client alone:

git clone https://github.com/dhiashalabi/frappe-js-client.git
cd frappe-js-client
pnpm install
pnpm test
pnpm lint
pnpm build
pnpm docs:start

Unit tests: pnpm test. Integration and browser tests require a separately managed Frappe site:

FRAPPE_TEST_URL=http://frappe14.localhost:8000 pnpm test:integration
FRAPPE_TEST_URL=http://frappe14.localhost:8000 pnpm test:browser

Live tests need a running site. Do not commit credentials (.env / .env.live are gitignored):

FRAPPE_LIVE_URL=http://127.0.0.1:8001 pnpm test:live

If the URL host is not the Frappe site name (for example 127.0.0.1 vs frappe16.localhost), pass siteName into createFrappeClient so requests send Host / X-Frappe-Site-Name.

License

MIT. See LICENSE.

Support