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 Loading

  1. kv kv Public

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

    TypeScript 32

  2. test test Public

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

    TypeScript 17

  3. env env Public

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

    TypeScript 8 3

  4. runtime runtime Public

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

    TypeScript 8 2

  5. service service Public

    Cross Runtime system service installer.

    TypeScript 7

  6. dir dir Public

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

    TypeScript 6

Repositories

Showing 10 of 14 repositories
  • kv Public

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

    cross-org/kv’s past year of commit activity
    TypeScript 32 MIT 0 0 0 Updated Nov 30, 2024
  • test Public

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

    cross-org/test’s past year of commit activity
    TypeScript 17 MIT 0 1 0 Updated Nov 29, 2024
  • service Public

    Cross Runtime system service installer.

    cross-org/service’s past year of commit activity
    TypeScript 7 MIT 0 0 0 Updated Nov 21, 2024
  • workflows Public

    Reusable workflow for Cross-Runtime CI actions

    cross-org/workflows’s past year of commit activity
    2 0 1 0 Updated Oct 13, 2024
  • utils Public

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

    cross-org/utils’s past year of commit activity
    TypeScript 4 MIT 1 0 0 Updated Oct 4, 2024
  • runtime Public

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

    cross-org/runtime’s past year of commit activity
    TypeScript 8 MIT 2 0 0 Updated Aug 28, 2024
  • jwt Public

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

    cross-org/jwt’s past year of commit activity
    TypeScript 6 MIT 0 1 0 Updated Jul 23, 2024
  • .github Public
    cross-org/.github’s past year of commit activity
    0 0 0 0 Updated May 15, 2024
  • fs Public

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

    cross-org/fs’s past year of commit activity
    TypeScript 4 MIT 0 1 0 Updated Apr 29, 2024
  • env Public

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

    cross-org/env’s past year of commit activity
    TypeScript 8 MIT 3 0 0 Updated Apr 18, 2024

Top languages

Loading…

Most used topics

Loading…