Skip to content
@cross-org

@cross

@cross/ on jsr.io, filling the cross-runtime gaps of @std/

@cross - Cross-Runtime JavaScript Libraries

Filling the gaps of @std/ on jsr.io - https://jsr.io/@cross

We develop essential cross-runtime libraries for Deno, Bun, and Node.js, extending the foundation of @std on JSR.io. Our libraries are designed for seamless cross-platform development, offering intuitive APIs and clear documentation.

  • @cross/fs: Complete cross-runtime utility library offering functions for file system operations, such as diskusage(), size(), readFile(), stat(), mktempdir().
  • @cross/utils: A toolbox of helpful cross-runtime utility functions like exit(), spawn(), args, ArgumentParser and more.
  • @cross/env: Simple and consistent environment variable management across runtimes.
  • @cross/runtime: Easily detect the current JavaScript runtime (Deno, Bun, Node.js, or browser), along with version, OS and more.
  • @cross/test: Write cross-runtime tests utilizing the build in test runners of Deno, Node and Bun. Works great with @std/assert and Sinon.
  • @cross/deepmerge: Deeply merge objects with flexibility and customizability across JavaScript environments.
  • @cross/base64: Efficient cross-runtime base64/base64url validation.
  • @cross/log: Flexible cross-runtime logging with customizable console styling, file output, log levels, and pluggable transports.
  • @cross/service: Cross-runtime service installer library for Systemd, Upstart, Sysvinit usable in Node, Deno and Bun.
  • @cross/dir: Cross-platform mechanism for retrieving the paths to standard user directories in Deno, Bun and Node.js
  • @cross/jwt: A versatile JSON Web Token (JWT) library.
  • @cross/kv: A fast, file based Key/Value Database with in-memory index for Node, Deno and Bun.
  • @cross/workers: Cross-runtime worker pool with TypeScript support

We have also...

... created a set of common reusable and configurable GitHub workflows to streamline cross-runtime compatibility testing with Deno, Node, and Bun. Find them at github.com/cross-org/workflows.

Quick Examples

@cross/env

import { getEnv } from "@cross/env";

const port = getEnv("PORT") || "3000";
console.log(`Server listening on port ${port}`);

@cross/log

import { Log } from "@cross/log";

const logger = new Log();

log.log("This is a log");
log.warn("This is a warning");
log.debug("This is not shown by default");

@cross/runtime

import { CurrentRuntime } from "@cross/runtime";

if (CurrentRuntime === "deno") {
  console.log("You're running Deno!");
}

@cross/utils

import { args, Colors } from "@cross/utils";

console.log(Colors.bgGreen(Colors.bold("Success!")))

const commandLineArgs = args();
console.log(commandLineArgs);

Get Involved

We welcome contributions! Here's how:

  • Raise an issue: Report bugs or suggest new features.
  • Submit a pull request: Directly improve our code.
  • Join our community: Discussions are open for questions and collaborations.

License

MIT License (See each libraries LICENSE file for details)

Popular repositories Loading

  1. kv kv Public

    A fast, lightweight, powerful and cross-platform key-value database for Node.js, Deno, and Bun.

    TypeScript 42

  2. test test Public

    Truly cross runtime minimal testing framework working in collaboration with @std/assert, for Node, Deno and Bun.

    TypeScript 22 1

  3. service service Public

    Cross Runtime system service installer.

    TypeScript 13

  4. runtime runtime Public

    Easily identify the current runtime environment (Node.js, browser, Deno, etc.) and its version with this minimal library.

    TypeScript 12 1

  5. env env Public

    Cross-runtime environment variable management for Deno, Bun, and Node.js

    TypeScript 10 3

  6. jwt jwt Public

    A versatile JSON Web Token (JWT) library with cross-runtime compatibility

    TypeScript 9 1

Repositories

Showing 10 of 16 repositories

Top languages

Loading…

Most used topics

Loading…