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

pi-sync

v0.2.3

Published

Auto sync codes to Raspberry Pi by SFTP, inspirated by docker-sync.

Downloads

14

Readme

pi-sync

npm version Build Status Coverage Status
Auto sync codes to Raspberry Pi by SFTP, inspirated by docker-sync.


Install

npm i -g pi-sync
# OR
npm i -D pi-sync

Node versions

node.js version 6+ needed.

Usage

Use Options

NOTE: Priority Level: options > pi-sync.conf.yml > Default Setting
IMPORTANT: An already-known bug occurs when try to sync a large project for first time, Plz use -s options when sync failed.

  Usage: pi-sync [options]


  Options:

    -V, --version            output the version number
    -w, --watch              Watch files change and sync
    -H, --host <host>        SSH host name of remote device
    -p, --port <port>        SSH port number of remote device
    -a, --account <account>  SSH account name of remote device
    -P, --pass <pass>        SSH password of remote device
    -k, --key <key>          Path to SSH private key
    -r, --remote <remote>    Remote path, must be absolute path
    -s, --safe               Use safe mode, if failed first time, try safe mode
    -h, --help               output usage information

  Examples:

    $ pi-sync --help
    $ pi-sync -H [email protected]:22 -k PATH/TO/KEY
    $ pi-sync -H [email protected]:22 -P raspberry
    $ pi-sync -H 192.168.1.1 -p 22 -a pi -P raspberry
    $ pi-sync -w -H [email protected]:22 -P raspberry
    $ pi-sync -w -H 192.168.1.1 # use pi@HOSTNAME:22, pw: raspberry by default
    $ pi-sync -s -H 192.168.1.1 -r /home/pi/Documents/PROJECT

Use Config File

Set pi-sync.conf.yml under repository root before use it. and run commands below.

Demo pi-sync.conf.yml

# NOTE: This sample configs could not used directly

connection: # connection setting of ssh/sftp 
  host: 192.168.x.xx # optional, default pi
  port: 22 # optional, default 22
  username: pi # needed
  password: raspberry # optional, but one of password or privateKey is needed
  # privateKey: PATH/TO/KEY # optional, but one of password or privateKey is needed
  readyTimeout: 10000 # optional, How long (in milliseconds) to wait for the SSH handshake to complete 

transport: # directory setting of sftp
  remotePath: ~/pi-sync # optional, default is ~/SAME-DIR-NAME
  localPath: ~/my-git/pi-sync # optional, default is current path
  execBefore: 'npm install' # optional, command run before transport
  execAfter: 'npm run build' # optional, command run after transport
  polling: 1500 # optional, defalt 1500ms, on --watch mode, stock changes and transport every few moment
  safeMode: false # optional, defalt false, if true, transport file one by one, slow but safe

ignore: # optional, additional ignore files which not in .gitignore
  - readme.md

include: # optional, additional include files which ignored by .gitignore
  - IM-IN-GITIGNORE.yml

Commands

# Batch sync
$(npm bin)/pi-sync

# Watch file changes and sync
$(npm bin)/pi-sync -w

Demo Images

Use options

Sync local pi-sync to /home/pi/Documents/pi-sync at [email protected]:22 once in safeMode. Sample Usage

Use config file and watch change

Sync local pi-sync by pi-sync.conf.yml and watch local file changes. Sample Usage

License (MIT)

Copyright 2017~2018 Jerry Lee