chrome-devtools-autosave-server
chrome-devtools-autosave-server copied to clipboard
Start on OS launch
Make a postinstall npm hook for all major operating systems.
http://en.wikipedia.org/wiki/Init
Mac OS X
Create a ~/Library/LaunchAgents/com.chrome.devtools.autosave.launchd.plist file with the following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.chrome.devtools.autosave.launchd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/autosave</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin</string><!-- dirname $(which node) -->
</dict>
<key>StandardOutPath</key>
<string>/var/log/autosave.log</string>
<key>StandardErrorPath</key>
<string>/var/log/autosave.error.log</string>
</dict>
</plist>
Make sure it works:
➤ launchctl load ~/Library/LaunchAgents/com.chrome.devtools.autosave.launchd.plist
➤ launchctl list | grep chrome
38609 - com.chrome.devtools.autosave.launchd
Enjoy.
Windows
http://en.wikipedia.org/wiki/Windows_Registry#Command_line_editing
Linux
- Ubuntu’s Upstart
- init.d
FreeBSD
Just made it work on Ubuntu, although I haven’t tested it much since I’m not Ubuntu user. Please npm link
the repo and let me know how it goes.