Skip to content

Instantly share code, notes, and snippets.

@AshKyd

AshKyd/tips.md Secret

Last active June 29, 2017 08:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AshKyd/3cffe04037956913db1ebd00aa0a0aa3 to your computer and use it in GitHub Desktop.
Save AshKyd/3cffe04037956913db1ebd00aa0a0aa3 to your computer and use it in GitHub Desktop.
Tips for working offline

Factoids:

NPM cache

NPM@5 has a much improved cache for working offline. Try the following arguments:

Argument Description
--offline Don't make network requests, just use what's in the cache already.
--prefer-offline Only make network requests if the cache doesn't have the required package.

DevDocs

DevDocs is a great resource for offline documentation. It's a HTML5 web app that lets you download HTML/CSS/JS/Node documentation and more, which is the perfect fit for the low throughput of CampJS.

Once installed, use the built-in search provider in your browser to type devdocs[tab] and search your docs!

Start a server

Offline, and need to run something? MacOS and Linux both come with Python, which will start a web server with the command python -m SimpleHTTPServer 8000

For a Node solution, you can npm install express and run the following:

const app = express()
app.use('/', express.static('/my/root/folder/'))
app.listen(8000)```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment