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.

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

  1. kv kv Public

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

    TypeScript 26

  2. test test Public

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

    TypeScript 10

  3. runtime runtime Public

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

    TypeScript 7 1

  4. dir dir Public

    Cross-platform mechanism for retrieving the paths to standard user directories in Deno, Bun and Node.js

    TypeScript 5

  5. env env Public

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

    TypeScript 4 3

  6. fs fs Public

    Cross Runtime (Deno, Node, Bun) filesystem operations for JavaScript and TypeScript

    TypeScript 4

Repositories

Showing 10 of 14 repositories
  • kv Public

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

    TypeScript 26 MIT 0 0 0 Updated Jun 9, 2024
  • test Public

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

    TypeScript 10 MIT 0 1 0 Updated Jun 7, 2024
  • utils Public

    A collection of useful routines to simplify cross runtime (Node, Deno and Bun) development.

    TypeScript 3 MIT 0 0 0 Updated May 24, 2024
  • jwt Public

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

    TypeScript 4 MIT 0 0 0 Updated May 22, 2024
  • .github Public
    0 0 0 0 Updated May 15, 2024
  • workflows Public

    Reusable workflow for Cross-Runtime CI actions

    1 0 0 0 Updated May 7, 2024
  • fs Public

    Cross Runtime (Deno, Node, Bun) filesystem operations for JavaScript and TypeScript

    TypeScript 4 MIT 0 1 0 Updated Apr 29, 2024
  • service Public

    Cross Runtime system service installer.

    TypeScript 3 MIT 0 0 0 Updated Apr 21, 2024
  • env Public

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

    TypeScript 4 MIT 3 0 0 Updated Apr 18, 2024
  • dir Public

    Cross-platform mechanism for retrieving the paths to standard user directories in Deno, Bun and Node.js

    TypeScript 5 MIT 0 0 0 Updated Mar 26, 2024

Top languages

Loading…

Most used topics

Loading…