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";constport=getEnv("PORT")||"3000";console.log(`Server listening on port ${port}`);

@cross/log

import{Log}from"@cross/log";constlogger=newLog();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!")))constcommandLineArgs=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 kvPublic

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

    TypeScript 50

  2. test testPublic

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

    TypeScript 24 1

  3. service servicePublic

    Cross Runtime system service installer.

    TypeScript 13

  4. env envPublic

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

    TypeScript 12 3

  5. runtime runtimePublic

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

    TypeScript 12 1

  6. jwt jwtPublic

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

    TypeScript 10 1

Repositories

Showing 10 of 17 repositories

Top languages

Loading…

Most used topics

Loading…