npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rigjs

v3.0.33

Published

A multi-repos dev tool based on yarn and git.Rigjs is intended to be the simplest way to develop,share and deliver codes between different developers or different projects.

Downloads

203

Readme

rig

中文文档

Get started

0.Prerequisites

Install yarn

yarn global add rigjs

Rigjs use yarn workspaces to achieve module-hoisting. About yarn workspaces.

NodeJS version >= 14

Use n to update NodeJS.

yarn global add n
#upgrade to lts
sudo n lts 
#or specify the version.
sudo n 14.19.1

1.Initialize rigjs configuration。

#in your project's root path(same level with package.json):
rig init

package.rig.json5 will be added in root path.

2.Use rigjs to install existing repos.

2.1 Method-one:rig add

rig add [your-git-ssh-url] [tag]

example:

rig add [email protected]:FlashHand/rig-demo-1.git 0.0.1

import or require the module.

const {hello} = require('rig-demo-1');
hello();

2.2 Method-two:change package.rig.json5

{
  dependencies: {
    'rig-demo-1': {
      source: '[email protected]:FlashHand/rig-demo-1.git',
      version: '0.0.1',
    }
  }
}

then

yarn install

3.Use rigjs to develop an existing repo.

3.1 Method-one:rig dev

rig dev [package's name|git-ssh-url]

When package is already in package.rig.json5:

rig dev rig-demo-1

When package is not in package.rig.json5:

rig dev [email protected]:FlashHand/rig-demo-1.git

rig-demo-1 will be installed in rig_dev directory.And a symlink of the module will be created in node_modules.

3.1 Method-two:change package.rig.json5

{
  dependencies: {
    'rig-demo-1': {
      source: '[email protected]:FlashHand/rig-demo-1.git',
      version: '0.0.1',
      dev: true //false by default
    }
  }
}

then

yarn install

4.Create and develop a new rigjs module。

4.1 Create a git repo。

get git-ssh url: [email protected]:FlashHand/rig-demo-1.git

4.2 Start developing your modules in rigjs dependencies

rig dev [email protected]:FlashHand/rig-demo-1.git

4.3 Initialize your module

cd your_project_path
cd rig_dev/rig-demo-1
yarn init 
echo "module.export={hello:()=>{console.log('hello')}}" > index.js

4.4 Use rigjs modules in your main project。

const {hello} = require('rig-demo-1');
hello();

4.5 Use rigjs module in production。

publish tag

cd rig_dev/rig-demo-1
git add .
git commit -m 'demo for rig'
git tag 0.0.1
git push origin your_branch --tag

Modify package.rig.json5

  • Change the module's version
  • Set dev to false.Don't use dev mode in production and should specify the version you need.
{
  dependencies: {
    'rig-demo-1': {
      source: '[email protected]:FlashHand/rig-demo-1.git',
      version: '0.0.1',
//      dev:true//Don't use dev mode in production.
    }
  }
}

In Electron Project

In Vite Project

Advantages

  • 💡Rigjs only needs git.No need to publish packages to private registry.
  • ⚡️Instant code sharing between multiple projects and multiple developers.Packages can be easily installed by git-ssh-url and tag.
  • ⚙️Auto npm link in dev mode.Import or require packages just like normal node_modules with friendly code suggestion.
  • 🔍Easily develop packages within your projects.Packages in dev mode are all in rig_dev folder.
  • 💨Easily transform existing code into a sharable package for multiple projects.
  • 📏Large content scale.You can share from a simple js file to multiple files that contains many pages.
  • 🧹Flat dependencies.No need to worry complex packages' relationship.

Goals

Sharing codes or files.

  1. Reuse codes between different developers or different projects in most flexible and unobtrusive way.
  2. Easily turn modules into developing mode,no need to use npm link or change package.json.
  3. Also support sharing files between projects like '.eslintrc.js' or 'tsconfig.json'...
  4. Developing one website in multiple modules.

Serverless CI/CD

  1. Build multiple versions for different environments at same time.
  2. Support deploying and publishing(Only support ali-cloud's oss and cdn by now).

Remote modules' helper(in development)

  • Working with webpack5's module federation.
  • Easily active modules' developing mode.
  • Friendly Code suggestion.
  • Simple router that can brings you everywhere.
  • Sandbox,state sharing....

Current Limits

  • Rigjs packages can share source code directly in node_modules.So transpiling or compiling might be needed.
  • Rigjs can not remove redundant codes for remote modules.
  • Although rigjs supports developing one website in multiple repos, But they all need to be built together into one application package. So it wastes time to build those unchanged modules ,which seems wrong when your website has hundreds or thousands of pages.
  • CI/CD only supports ali-cloud's oss and cdn.I don't have plans to make it better for now.

I'm still developing new features in most flexible and unobtrusive way.So my team won't cost extra time to upgrade their applications' architecture.

Rigjs works great for my team in development of vue-apps,uni-apps,electron apps and nodejs apps.If you don't need many remote modules,it will work fine for you too.