Code Monkey home page Code Monkey logo

jsr-npm's Introduction

JSR npm command line tool

The JSR npm CLI integrates JSR (JavaScript Registry) packages with npm-based projects, facilitating the use of JSR packages in environments that traditionally rely on npm. Learn more about JSR at jsr.io.

Quick Start

Add a JSR package to your project:

npx jsr add @package/name  # 'install' and 'i' are also supported

This command auto-updates your package.json and installs the package, automatically detecting and using your project's package manager.

How It Works

The CLI creates or updates a .npmrc file in your project with:

@jsr:registry=https://npm.jsr.io

This line redirects npm to fetch JSR packages from the JSR registry instead of the default npm registry.

Packages are added to package.json with an alias, mapping the JSR package name to the npm registry URL hosted by JSR, like so:

{
  "dependencies": {
    "@luca/flag": "npm:@jsr/luca__flag@1"
  }
}

This ensures that the package is fetched from JSR when you run npm install commands.

Commands

  • add, install, i: Adds a JSR package to your project.
  • remove, uninstall, r: Remove a JSR package from your project.
  • publish: Publish package.json libraries to JSR.

Limitations

  • jsr: import specifiers are not supported.
  • Due to transpilation, the developer experience in editors might differ from native JSR usage.

For the best developer experience and to fully leverage JSR's capabilities, consider environments with native JSR support like Deno.

Contributing

We welcome contributions and feedback. Visit our GitHub repository to contribute or report issues.

License

This CLI is available under the MIT License.

jsr-npm's People

Contributors

marvinhagemeister avatar ry avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.