Skip to content

Instantly share code, notes, and snippets.

@derhuerst
Last active October 3, 2018 20:30
Show Gist options
  • Save derhuerst/014fe183bbf827645ffbd14f632da764 to your computer and use it in GitHub Desktop.
Save derhuerst/014fe183bbf827645ffbd14f632da764 to your computer and use it in GitHub Desktop.
working offline as JavaScript dev

working offline as JavaScript dev

use npm@5

npm installs large dependency trees a lot faster. this is especially noticable over slow networks.

Running npm while offline will no longer insist on retrying network requests. npm will now immediately fall back to cache if possible, or fail. (npm/npm#15666)

use node_modules/*/readme.md

installed npm modules always contain readmes.

npm install -g readme

The readme command will traverse both local node_modules directories from the current directory and will also pull up documentation for packages you've installed globally. You can even read the core docs offline:

use offline docs

You can download offline docs and search them. Mac users should use Dash, all others should use Devdocs.

airpaste, serve, mDNS

If you are on the same wifi as somebody else, you can easily copy data from one computer to the other by typing airpaste. This way you don't need to upload files to a server all the way across the internet just to copy some bits to a machine a few meters away.

npm install -g airpaste
airpaste < somefile.jpg
airpaste > somefile.jpg

serve is a tiny static HTTP server. Use it to share files locally with non-technical people.

ZeroConf (a.k.a Bonjour or mDNS) exposes computers in the local network as some-hostname.local Set your hostname to something meaningful.

see also

This list is heavily inspired by productivity tips for an offline world by substack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment