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

@raptortwentyone/sap-rfc

v0.1.0

Published

Typed access to SAP tables over the RFC_READ_TABLE family, for Node.

Readme

Raptor21 SAP RFC for TypeScript

Typed access to SAP tables from Node, over the RFC_READ_TABLE family.

CI

The Node port of Raptor21.SAP.RFC, beside its JVM sibling Raptor21.SAP.RFC.Java. The wire behaviour is the .NET library's, deliberately: everything measured there against live systems is recorded as conformance fixtures, and this runtime's suite asserts the same envelopes, the same response parses and the same OPTIONS splits, byte for byte.

import { SapClient } from "@raptortwentyone/sap-rfc";
import { Kna1 } from "./sap/Kna1.js";

const sap = SapClient.connect({
  name: "S4",
  baseUrl: "https://s4.example.com:44300",
  user: "READER",
  password,
  client: "100",
});

const customers = await sap.from(Kna1.ENTITY)
  .where(Kna1.Columns.LAND1.eq("TR").and(Kna1.Columns.ERDAT.ge("2024-01-01")))
  .select(Kna1.Columns.KUNNR, Kna1.Columns.NAME1, Kna1.Columns.ORT01)
  .take(5)
  .list();

where is sent as SAP's OPTIONS clause and select as its field list, so filtering and projection happen in SAP rather than after the rows arrive. A condition SAP cannot answer correctly is refused while the query is built, never silently: a filter on a column whose conversion exit depends on the system's own customising throws instead of returning confident, wrong rows. For large reads, for await (const row of query.stream()) pages with the measured ROWCOUNT rules.

How values are represented

Chosen for exactness first, because JavaScript's number cannot carry what some columns hold:

  • DEC, CURR, QUAN — exact decimal strings. A number holds 53 bits of precision and a packed column up to 31 digits; a float would silently misread the wide ones. Currency scaling — a stored yen 10.00 really being ¥1000 — shifts the decimal point in the digits, exactly.
  • INT8 — bigint. Nineteen digits, same reason.
  • DATS, TIMS — ISO strings (2024-01-15, 14:30:45), null for never-set. SAP's end-of-day 240000 is simply "24:00:00" — no sentinel value needed, and it round-trips.
  • Timestamps — ISO UTC strings with up to seven fractional digits (2024-08-04T13:45:30.1234567Z): the stored resolution is 100 nanoseconds, which a Date's milliseconds would silently truncate.
  • RAW — Uint8Array.

Getting the classes

Kna1 above is generated. The scaffolder ships with the .NET package and gained a TypeScript target:

dotnet <package>/tools/net10.0/Raptor21.SAP.RFC.Tool.dll scaffold \
    --tables KNA1,TVKO --target typescript --out src/sap

One scaffolder for every language on purpose. The Data Dictionary pipeline — one round trip per table, conversion exits, reference fields, the domain test that tells a timestamp from a quantity — lives once, and each language is only a renderer at the end of it. The generated file is ordinary source: read it, review it, commit it.

No .NET on the machine? The same tool ships as a native, self-contained binary (~7 MB) on each release of the .NET repository — raptor21-sap-rfc-tool-<platform> under releases; download the one for your platform and run it directly with the same arguments, no runtime required.

Requirements

  • Node 18 or newer to consume the published package; Node 23.6+ to run this repository's own tests, which go straight through Node's type stripping with no build step.
  • No dependencies: the transport is fetch, the values are strings, numbers and bigints.
  • A SAP system whose SOAP RFC endpoint (/sap/bc/soap/rfc) is reachable, and a user with S_RFC authorisation for the table-reading function modules.

Building

npm ci
npm test
npm run build

npm run sync-conformance refreshes the conformance snapshot from a sibling Raptor21.SAP.RFC checkout; the suite fails when the sibling is present and the snapshot is stale.

Licence

MIT — see LICENSE.


Raptor21 SAP RFC is an independent, community-developed library. It is not affiliated with, sponsored by, or endorsed by SAP SE. SAP, SAP S/4HANA and ABAP are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. This library is designed for use with SAP software and is not an SAP product.