• Stars
    star
    123
  • Rank 290,145 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 5 years ago
  • Updated 12 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Never have to switch between npm and yarn commands ever again

narn

Never have to switch between yarn, npm, and pnpm commands ever again.

narn is a CLI that detects whether your current npm package is using npm, yarn, or pnpm. It then spawns the correct one with the correct arguments. The arguments to narn itself are exactly the same as if you're using yarn. The command will be converted to npm or pnpm's syntax if the current package is managed by npm / pnpm.

Installation

npm i -g narn

yarn global add narn

pnpm i -g narn

Extras

If you run narn upgrade-interactive on a project managed by npm, you'll need to globally install ncu.

If you run narn publish on a project managed by npm, you'll need to globally install np.

Usage

# To install from package.json
narn # or narn install

# To add new package
narn add react

# To remove a package
narn remove react

# Add a dev dependency
narn add --dev webpack
narn add -D webpack

# Run a script from the package.json
narn test
narn build

# Publish with interactive UI
narn publish

# Upgrade dependencies with interactive ui
narn upgrade-interactive
narn upgrade-interactive --latest

# Install global library. All global libs are installed with yarn (since the most important thing is just that you consistently use the same package manager for global libs)
narn global add @vue/cli

# yarn create single-spa is similar to npm init single-spa
narn create single-spa

# View the installed versions of narn and yarn/npm
narn -v
narn --version

# global commands are supported too
narnx global add http-server
narnx global remove http-server

# Run npx / pnpx
narnx create-single-spa

For more usage, see the Yarn CLI docs - narn's cli is meant to behave exactly the same.

Default Package Manager

To set the default package manager that's used in projects that don't have a yarn.lock, pnpm-lock.yaml, or package-lock.json, set the NARN_DEFAULT_PM environment variable. You can also add this to your bashrc (or equivalent) to ensure the variable is always there.

export NARN_DEFAULT_PM=pnpm
narn

Publish behavior

By default, narn uses np on npm and pnpm projects. However, np doesn't support pnpm. Because of that, it might be desireable to turn off np as the handler for npm publish. To disable np, set the following environment variable:

export NARN_PUBLISH=passthrough
narn publish

More Repositories

1

coexisting-vue-microfrontends

A repo showing separate vue apps coexisting as microfrontends with single-spa
JavaScript
610
star
2

simple-single-spa-webpack-example

A simple example of how to use webpack with single-spa
JavaScript
282
star
3

coexisting-angular-microfrontends

Multiple angular applications, coexisting in one page via single-spa.
TypeScript
211
star
4

systemjs-webpack-interop

An npm package for webpack bundles that are used by systemjs
JavaScript
93
star
5

vite-single-spa-example

JavaScript
63
star
6

utahjs-2019

JavaScript
15
star
7

vite-single-spa-root-config

EJS
12
star
8

single-spa-es5-angularjs

A single-spa example with an es5 angularjs app
HTML
12
star
9

import-map-service-worker

JavaScript
11
star
10

snowpack-single-spa-example

An example of a snowpack application that serves as a single-spa application
8
star
11

single-page-react

Lightweight, straightforward plugin for creating single page apps with React
JavaScript
7
star
12

live-import-map-deployer

JavaScript
6
star
13

eslint-config-important-stuff

An eslint config focused on catching bugs without being annoying
JavaScript
5
star
14

add-esmodule

Add __esModule property to native ES module objects
JavaScript
3
star
15

eslint-config-ts-react-important-stuff

An eslint config for important stuff in react / typescript projects
JavaScript
3
star
16

eslint-config-react-important-stuff

An eslint config for react important stuff
JavaScript
2
star
17

kremling

The smallest, fastest es6 to System.register compiler you'll find.
JavaScript
2
star
18

vue-3-single-spa

JavaScript
2
star
19

openmrs-esm-hackathon-seed

A seed repo for hackathons
JavaScript
2
star
20

single-spa-jspm

Helpers for making jspm applications compatible with single-spa
JavaScript
2
star
21

js-correct-lockfile

Test that incoming pull requests use the correct lockfile (npm, yarn, pnpm)
JavaScript
2
star
22

hot-reloading-meetup

JavaScript
1
star
23

system-import-chaining

https://github.com/systemjs/systemjs/issues/1954
HTML
1
star
24

shell-setup

Joel's favorite aliases and other shell stuff
Shell
1
star
25

make-fetch-happen-304

JavaScript
1
star
26

autopublish-template

JavaScript
1
star
27

scoped-bootstrap

JavaScript
1
star
28

multiple-react-instances

HTML
1
star
29

unimg

JavaScript
1
star
30

openmrs-esm-hackathon-seed-angular

Starter repo for kenya hackathon with angular
TypeScript
1
star
31

eslint-config-node-important-stuff

An eslint config that works for backend node projects
JavaScript
1
star
32

react-query-issue

1
star
33

bandicootjs

A scenario-based browser framework
JavaScript
1
star
34

single-spa-globals

A single-spa plugin for apps that leak globals
JavaScript
1
star
35

openmrs-esm-navbar

The navbar for the kenya hackathon
TypeScript
1
star
36

react-app-single-spa-test

JavaScript
1
star
37

openmrs-esm-patient-dashboard

Patient dashboard, for the Kenya hackathon
TypeScript
1
star
38

eslint-config-ts-important-stuff

No rules except important ones. For Typescript
JavaScript
1
star