Courtesy: https://www.youtube.com/watch?v=2zpfWJCdNAI
A Pen by Bhavesh Gohel on CodePen.
// Create Base64 Object | |
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){var t="";var n,r,i,s,o,u,a;var f=0;e=Base64._utf8_encode(e);while(f<e.length){n=e.charCodeAt(f++);r=e.charCodeAt(f++);i=e.charCodeAt(f++);s=n>>2;o=(n&3)<<4|r>>4;u=(r&15)<<2|i>>6;a=i&63;if(isNaN(r)){u=a=64}else if(isNaN(i)){a=64}t=t+this._keyStr.charAt(s)+this._keyStr.charAt(o)+this._keyStr.charAt(u)+this._keyStr.charAt(a)}return t},decode:function(e){var t="";var n,r,i;var s,o,u,a;var f=0;e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");while(f<e.length){s=this._keyStr.indexOf(e.charAt(f++));o=this._keyStr.indexOf(e.charAt(f++));u=this._keyStr.indexOf(e.charAt(f++));a=this._keyStr.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r)}if(a!=64){t=t+String.fromCharCode(i)}}t=Base64._utf8_decode(t);return t},_utf8_encode:function(e){e=e.replace(/\r\n/g,"\n");var t="";for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);if(r |
# Node-WebKit CheatSheet | |
# Download: https://github.com/rogerwang/node-webkit#downloads | |
# Old Versions: https://github.com/rogerwang/node-webkit/wiki/Downloads-of-old-versions | |
# Wiki: https://github.com/rogerwang/node-webkit/wiki | |
# How: https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium | |
# 1. Run your application. | |
# https://github.com/rogerwang/node-webkit/wiki/How-to-run-apps |
https://github.com/rogerwang/node-webkit | |
https://github.com/atom/atom-shell | |
https://github.com/adobe/brackets-shell/ | |
http://documentup.com/arturadib/node-qt | |
http://deskshell.org/demo-docs/tutorials/start.htm | |
http://www.sencha.com/blog/using-native-apis-in-sencha-desktop-packager | |
http://blogs.telerik.com/kendoui/posts/12-12-04/desktop_apps_the_final_frontier_for_html5 | |
http://www.tidesdk.org/ | |
http://www.awesomium.com/ | |
https://developers.pokki.com/ |
Courtesy: https://www.youtube.com/watch?v=2zpfWJCdNAI
A Pen by Bhavesh Gohel on CodePen.
The final result: require() any module on npm in your browser console with browserify
This article is written to explain how the above gif works in the chrome (and other) browser consoles. A quick disclaimer: this whole thing is a huge hack, it shouldn't be used for anything seriously, and there are probably much better ways of accomplishing the same.
Update: There are much better ways of accomplishing the same, and the script has been updated to use a much simpler method pulling directly from browserify-cdn. See this thread for details: mathisonian/requirify#5
Disclaimer: This is an unofficial post by a random person from the community. I am not an official representative of io.js. Want to ask a question? open an issue on the node-forward
discussions repo
These instruction are for Windows, on my Linux installation(Fedora 21) everything works by just installing serialport with npm (I don't know why!).
These are the steps I did to build node serialport for electron (formerly atom-shell) for Windows. I am completely certain there is a better way to do it, but since I struggled with it for quite a while, here is a solution anyway.
You need some version of Visual studio installed, I have VS 2012 Express for Desktop.
//run this with 'node server.js' and then test in multiple computers using 'telnet 192.168.0.1 9000' | |
// replace '192.168.0.1' with your ip. | |
(function () { | |
'use strict'; | |
let net = require('net'); | |
let chatServer = net.createServer(), | |
clientList = []; // a list of connected clients/ machines | |
chatServer.on('connection', function (client) { | |
//once a client connects we add it to our clientList |
// From callbacks to Promises to async functions | |
function callbackFunc(x, callback) { | |
f1(x, (err1, result1) => { | |
if (err1) { | |
console.error(err1); | |
callback(err1); | |
return; | |
} | |
f2(result1, (err2, result2) => { |