Giter Club home page Giter Club logo

npm-sync's Introduction

npm-sync

Sync npm packages between projects.

This project was developed to fix React hook issues caused by npm link.

Features

  • Super simple to use
  • Uses rsync to efficiently sync files
  • Uses npm’s official npm-packlist to establish which files to sync
  • Uses trusted dependencies (chokidar, commander, fs-extra, etc…)
  • Very light codebase to audit (less than 200 lines of code)
  • Written in TypeScript

Installation

Heads-up: npm-sync depends on rsync which is installed by default on macOS.

npm install -g npm-sync

Usage

$ npm-sync -h
Usage: npm-sync [options]
Options:
  --src <source>        path to package (default: process.cwd())
  --dest <destination>  path to project
  --no-deps             do not sync package dependencies
  --watch               watch package for changes
  --verbose             show more debug info
  --yes                 skip confirmation prompt
  -h, --help            display help for command

Example

In following example, we are developing a React component called react-cms (packaged as @sunknudsen/react-cms) that we are planning to publish to npm.

Before publishing @sunknudsen/react-cms, we would like to import component from project called sunknudsen-website to see if everything is working (we tried npm link and things were broken).

$ pwd
/Users/sunknudsen/Code/sunknudsen/react-cms

$ npm-sync --dest /Users/sunknudsen/Code/sunknudsen/sunknudsen-website --watch
Syncing @sunknudsen/react-cms to /Users/sunknudsen/Code/sunknudsen/sunknudsen-website/node_modules/@sunknudsen/react-cms…
? Do you wish to proceed? Yes
Synced @sunknudsen/react-cms to to /Users/sunknudsen/Code/sunknudsen/sunknudsen-website/node_modules/@sunknudsen/react-cms
Watching @sunknudsen/react-cms for changes…

Contributors

Sun Knudsen

Licence

MIT

npm-sync's People

Contributors

sunknudsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

npm-sync's Issues

Cannot convert undefined or null to object

Hi! It's me again :D

Just wanted to try out npm-sync, but I receive the following error:

npm i -g npm-sync
npm-sync --dest /Users/yss/Dev/opensource/<my-project> --watch --no-deps --yes --verbose
Cannot convert undefined or null to object

System: macOS 11.1
Node: 15.6.0
rsync: 2.6.9 (preinstalled by macOS)

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.