background preloader

Node.js

Facebook Twitter

Mikeal/filed. Tinkering. Creating Desktop Applications With node-webkit. Web applications are useful, but there are some cases where it’s not desirable or necessary to host an application on a remote server. As HTML5 provides low-level functionality to modern browsers, such as the ability to read and write files, it’s now possible to create offline, single-page, JavaScript applications using a web browser as a platform.

While browser-based unhosted applications present some interesting possibilities, such as the ability to deploy your application on multiple operating systems, there are some significant limitations. When using browsers one’s control of the user interface is limited. Some interface elements, such as pull-down menus, can’t be customized and there is usually no way to hide the browser’s address bar programatically. Another potential issue with web applications in general is variance between browsers and browser versions. Last, but not least, most browsers are configured to be secure against malicious content.

Enter Node-WebKit Installation <! Appersonlabs/docker.io. Npm. Moment. A lightweight javascript date library for parsing, validating, manipulating, and formatting dates.

moment

There are a number of small backwards incompatible changes with version 2.0.0. See them and their descriptions here Changed language ordinal method to return the number + ordinal instead of just the ordinal. Changed two digit year parsing cutoff to match strptime. Removed moment#sod and moment#eod in favor of moment#startOf and moment#endOf. Removed moment.humanizeDuration() in favor of moment.duration().humanize(). Removed the lang data objects from the top level namespace. Duplicate Date passed to moment() instead of referencing it.

Develop Master You need node, use nvm or nenv to install it. Then, in your shell git clone https: cd moment npm install -g grunt-cli npm install git checkout develop # all patches against develop branch, please! Async. Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript.

async

Although originally designed for use with Node.js, it can also be used directly in the browser. Also supports component. Async provides around 20 functions that include the usual 'functional' suspects (map, reduce, filter, each…) as well as some common patterns for asynchronous control flow (parallel, series, waterfall…). All these functions assume you follow the Node.js convention of providing a single callback as the last argument of your async function. Quick Examples async.map(['file1','file2','file3'], fs.stat, function(err, results){ }); async.filter(['file1','file2','file3'], fs.exists, function(results){ }); async.parallel([ function(){ ... }, function(){ ... }], callback); async.series([ function(){ ... }, function(){ ... }]); Q. :warning: This is Q version 2 and is experimental at this time.

q

If you install the latest Q from npm, you will get the latest from the version 1 release train. You will get the lastet of version 2 if you use npm install q@~2. Consult CHANGES.md for details on what has changed Among the significant differences in version 2, the source is CommonJS only and versions suitable for use with AMD and plain <script> tags are built and published for download with each release. If a function cannot return a value or throw an exception without blocking, it can return a promise instead. Getting Started The Q module can be loaded as: A <script> tag (creating a Q global variable): ~2.5 KB minified and gzipped.

Q can exchange promises with jQuery, Dojo, When.js, WinJS, and more. Resources Our wiki contains a number of useful resources, including: A method-by-method Q API reference.A growing examples gallery, showing how Q can be used to make everything better. Introduction. Node-RED.

Node.js. Building a Node OAuth2 server. At Papers we have been looking for an authentication solution that: Allowed us not to store sensitive data in the client -- namely usernames and passwords.

Building a Node OAuth2 server

Was relatively easy to implement in Cocoa and .NET. We decided to go for what's known as resource owner password flow and chose node-oauth2-server to build our server. While Papers is not open-source, Alex has put together a lightweight implementation that uses the node-oauth2-server module and mirrors Papers' authentication process. This is currently available on GitHub for you to play around with as well. This article is a walkthrough of Papers' test-driven implementation of an OAuth server using Node. Resource owner password flow The reason we used resource owner password flow is because we're implementing "first party clients" -- we build and distribute Papers for Mac, Papers for Windows, Papers for iOS, and the OAuth server. These tokens can expire, so OAuth2 servers usually send a refreshToken as well. Tools and dependencies. Rogerwang/node-webkit.

Alidavut/locus. Dshaw/replify.