Node.js Web Development

Electron considered harmful because it rides on Chromium

(September 24, 2017)

Electron is perhaps the greatest gift to cross platform application development in ages. I've been working on cross platform application development for over 20 years, with over 10 years spent IN the Java SE team at Sun. Today I'm a happy Node.js developer, and have spent the last couple months learning Electron and am totally enjoying the application-writing experience in Electron. It is so easy and quick to develop desktop applications using a repurposed web browser. Development is fast and intuitive, assuming you're familiar with HTML and CSS and JavaScript website development.

But a nagging thought came to mind yesterday. That Electron application requires running a large portion of the Chrome web browser. Meaning, my laptop not only has the regular Chrome browser running, but another in GitKraken, another in Visual Studio Code (and I'd been running Atom before discovering VSCode), and yet another for the application I'm developing. That's four Chrome instances, and the result simply is not scalable. Each additional running Electron-based app causes a whole new Chrome instance to exist. Is Electron an unscalable mess?

Node.js forked, Ayo.JS, is trying to find its way

(Sat Sep 23 2017 17:00:00 GMT-0700 (PDT))

A month ago we suddenly had news of a hostile fork of Node.js, called Ayo.js, by Node.js team members upset over what they called Code of Conduct violations. Supposedly another Node.js team member was routinely harrassing people (a claim he has denied) and spoke against having a Code of Conduct. I don't know whether any of that is true. What's necessary is to check in with Ayo.js, see what they're doing, and if there is any compelling technical reason for their existence.

Going by the Ayo.js issue queue, that team is considering the same problem. Several issues are suggesting breaking changes with Node.js, that might produce a superior implementation. In one issue the folks are explicitly debating whether they should maintain one-for-one compatibility, or to strike out on their own.

Yarn versus npm, what's the big deal?

(Tue Sep 19 2017 17:00:00 GMT-0700 (PDT)) A couple years ago Yarn came onto the Node.js scene promising to be a better npm than npm. Apparently a lot of people have taken to Yarn, given the frequency with which I see instructions to install packages using Yarn. Since npm is installed along with Node.js, and since Yarn just uses the npm package repository, I'm left wondering what all the fuss is about Yarn. If it's just doing the same thing as npm then what is its reason to exist? What advantage does Yarn have over npm? Let's take a look.

Loading jQuery and Bootstrap in Electron app has a curious bug

(September 2, 2017) What about using jQuery/Bootstrap to design an Electron app? It's easy to get started, right? You just load the jQuery and Bootstrap JavaScript libraries in that order. The process is well documented on the Bootstrap website, and since Electron is a web browser the same technique should work. But -- you get an inscrutible error that jQuery needs to be loaded. Which is odd because the HTML does indeed load jQuery, and in the Developer tools you can inspect the loaded files and see that jQuery is loaded. WTF?

Node.js has been forked over Terms of Conduct violations forming Ayo.JS project

(Tue Aug 22 2017 17:00:00 GMT-0700 (PDT))

Over the last couple days, a group of Node.js project members who'd worked in the Technical Steering Committee resigned, and at the same time Node.js was forked to create the Ayo.js project. The name was chosen because it's pronounced similarly to IO, in other words this seems to be an attempt to resurrect the IO.JS fork. According to Twitter and Medium postings I've found, there are allegations of repeated Code of Conduct violations by one TSC member, and an unwillingness of other committee members to take action. Bottom line, the people involved are questioning whether the leadership of the Node.js project are properly committed to "community" and "inclusivity".

An open source software project is about much more than the code. A successful project is comprised of a community of people successfully working together. Often such projects are volunteer driven, and membership is on merit and contributions. Bottom line is that community dynamics often drive decisions about who is "in" the project and who isn't. By contrast contributing to a traditional commercial software project simply means having been hired by a company to do the work.

Message send from Electron Main process not received by Renderer

(August 13, 2017) Sending messages between Electron's main process and the Renderer looks simple. In the Renderer you use ipcRenderer to send a message to the main process, and in the main process you use windowObject.webContents.send to send the message. But what about when the process doesn't work and the documentation doesn't make it clear what to do?

Node.js team adopts the Contributor Code of Conduct, fostering a welcoming environment for contributors

(Wed Jul 19 2017 17:00:00 GMT-0700 (PDT))

Yesterday the Node.js project adopted the Contributor Covenant Code of Conduct which is an important step towards fostering an open and welcoming environment ensuring the project is a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. While this isn't a cool piece of technology, it is a step which should give the Node.js project a firmer standing in the world. In the past some open source projects have run into serious problems when team members acted with discrimination or harassment towards other team members. Having taken a stand like this, the team has put a firm stake in keeping the community open to all.

Correctly match URL against domain name without killing yourself with regular expressions

(2017-07-05 21:41)

The Internet relies on domain names as a more user-friendly humane address mechanism than IP addresses. That means we must often write code checking if a URL is "within" domain A or domain B, and to act accordingly. You might think a regular expression is the way to go, but it has failings because while a URL looks like a text string it's actually a data structure. A domain name comparison has to recognize that it's dealing with a data structure, and to compare correctly. Otherwise a URL with domain name "loveamazon.com" might match the regular expression /amazon.com$/i and do the wrong thing.

Books and videos so you can easily learn Node.js programming

(2017-07-01 11:19)

Have you heard about Node.js, but aren't sure what it is? Maybe you know about this exciting new software development platform, Node.js, but don't know where to start learning it? Maybe someone told you Node.js is JavaScript for server-side environments, which left you extremely confused? Or maybe you've never heard of server-side-JavaScript, and think JavaScript only runs inside web pages? The following resources will help you learn how to develop in JavaScript not inside a web browser, but on the server, using the Node.js platform.

Node.js is an exciting new platform for developing web applications, application servers, any sort of network server or client, and general purpose programming. It is designed for extreme scalability in networked applications through an ingenious combination of server-side JavaScript, asynchronous I/O, and asynchronous programming. Its claimed that the event-driven architecture gives a low memory footprint, high throughput, a better latency profile under load, and a simpler programming model. All this makes it an attractive platform for web application development.

In JavaScript (Node.js), how do I read a text file from a different directory and store into a string?

(2017-06-18 22:57) Built-in to Node.js are a few packages providing core services, including the "fs" package. As the name implies, it interfaces with the file-system, and among its functions is readFile that reads a file completely into memory. So, the short answer to this question is to simply call fs.readFile but we should take a longer look than that.

Troubles with Asynchronous code flows in JavaScript, and the async/await solution of ES-2017

(2017-01-22 21:25)

Asynchronous coding is one of those powerful tools that can bite, if you're not careful. Passing around anonymous so-called "callback" functions is easy, and we do it all the time in JavaScript. Asynchronous callback functions are called, when needed, as needed, sometime in the future. The key result is that code execution is out-of-order with the order-of-appearance in the code.

New Book: Asynchronous JavaScript with Promises, Generators and async/await

(2017-01-01 11:19) The JavaScript language is changing, and among the changes are three new features which will revolutionize the way we write asynchronous code in JavaScript. The problem with the old callback-oriented asynchronous coding practice is the Callback Hell resulting from stacking callbacks within callbacks within callbacks. Between Promises, Generators and the proposed async/await feature, JavaScript programmers can largely free themselves from Callback Hell, and write clean asynchronous code that's easier to write, easier to understand, easier to maintain, and more robust.

Asynchronous array operations in ES7 JavaScript async/await functions

(2016-11-26 22:53)

A glaring problem with the most excellent async/await feature in JavaScript is all the existing coding structures that only work with synchronous code. In an async/await function it's trivially easy to write a simple "for" loop that contains whatever async/await calls you want. But as soon as you try "Array.forEach" with an async callback function it will fail miserably. That's because this function, like so many existing interfaces which take a callback function, assumes the callback is synchronous. Instead of waiting for the Promise to resolve, it plows on ahead executing the next iteration.

Useful reading to understand the Promises, Generators and the async/await feature for Node.js/JavaScript

(2016-11-20 17:01)

The long-awaited async/await feature for JavaScript promises to make our lives much easier. Instead of asynchronous JavaScript programming being tricky and error-prone, with async/await our code will look like regular synchronous code we write in other languages, but will accommodate asynchronous code execution while retaining the single-threaded nature of JavaScript. With this feature we declare async functions, and within their boundary magic occurs - we can put the "await" keyword in front of a function which produces a Promise, and automagically JavaScript will wait for the Promise to resolve and give us the result or else throw the error. What follows is a list of posts describing how to use async/await.

Memory-efficient CSV transformation in Node.js

(2016-11-14 17:06)

Those of us who consume/edit/modify/publish CSV files must from time to time transform a CSV file. Maybe you need to delete columns, rearrange columns, add columns, rename volumes, or compute some values taking one CSV file and producing another. In my case, I have a raw CSV file with no column headers that's organized in a way which makes sense for one team in our company, but we need that same data organized a different way, with different column names and containing selected fields. The following is what came from that need, which I managed to write in a fairly generic way. It not only extracts and renames columns, but with a bit of coding could perform other transformations.

The advent of async/await for Node.js - Node.js v7 has now arrived

(2016-10-25 08:35)

With today's first release of Node.js version 7, we now have async/await as a base feature of the platform. This is a significant milestone that wasn't even mentioned in the commit message. The async/await feature is so important that I'm preparing a short book to discuss JavaScript asynchronous programming patterns, that highly features async/await.

Easily import your CSV data into MySQL with Node.js

(2016-09-16 10:59)

It's convenient to import a CSV file into a spreadsheet to crunch numbers. CSV's (comma-seperated-values) and it's brethren (TSV, for tab-separated, etc) are widely used to deliver information. You'll see CSV downloads available all over the place, whether it's your stock broker or bank, or a government agency, and on and on. Spreadsheet programs like LibreOffice Calc offer direct import of these files, and then as a spreadsheet you've got a zillion tools available to crunch numbers, make graphs, etc. Sometimes, though, you need to load the CSV into a database to do other sorts of work.

Fixing "Maximum call stack size exceeded" in async Node.js code

(2016-09-09 13:20)

I've happily used the async module for Node.js for years to simplify asynchronous operations over arrays. This is a difficulty in the Node.js paradigm, since the "normal" way to process an array is with a simple for loop. But if the operation is asynchronous the for loop has no way of knowing when to iterate to the next item, or even when processing is finished. Instead the async.eachSeries function does the trick, because your code tells async.eachSeries when to go to the next item, when there's an error, and it knows when the last item is processed, etc. It's been great.

Deprecating buggy npm packages, dealing with deprecations

(2016-08-25 10:20) It seems several critical npm packages deprecated older releases. Installing the old version of some packages causes npm to print a warning saying the package was deprecated, and to use a newer version of the package. Sometimes the message suggests a way to figure out where the package is being required. Due to the way an npm package can pull in other npm packages, it can be tricky to figure out where the deprecated package version is being used.

Is Node.js / Express scalable? How to grow Node.js app deployment to handle more traffic?

(2016-05-01 09:29) Since Node.js is billed as being very fast, high performance, application development platform, you might think it automatically "scales" to fill out server resources and satisfy a huge workload. While you can do this with a Node.js application, you have to design the scaling mechanism yourself. With no additional configuration, a Node.js application can saturate a single CPU core and handle as many transactions as that core can sustain. That doesn't help when your manager asks why that 32 core server you just ordered has 31 idle CPU cores and one running flat out. Out of the box Node.js doesn't scale, but it's possible to make it do so.

How does Node.js compare to a traditional MVC platform like Spring?

(2016-04-27 23:07)

Node.js is a young software development platform. It's only about 6 years old, and many software developers are still unsure about where Node.js fits into the landscape. It's JavaScript, which many people pigeon-hole as a browser language, but Node.js doesn't run on browsers but on servers. The question above illustrates a fundamental confusion about what Node.js is, and its role in the world, because it is not an "MVC" but a complete programming platform.

Node.js 4.0.0 is out - quick tip for use while testing compatibility

(2015-09-09 17:58)

Node.js v 4.0.0 was just released. This is a long-awaited release representing the healing of the schism in the Node.js community created when the io.js project forked Node.js. That had been done over a disagreement about the policies and maintainership of Node.js. Joyent had been in control of the project (because Ryan Dahl had been employed by Joyent) and not all in the community liked the decisions made by Joyent. They instead forked the project to create io.js, and implemented a bunch of useful ideas for example to adopt the latest-and-greatest version of the V8 JavaScript engine in order to get all the modern ES6 goodies.

The difference between Node.js require, and Wordpress plugins or Drupal modules

(2015-07-19 18:25)

Someone experienced with using Wordpress, or Drupal, to build websites are accustomed to "plugins" or "modules". Both are software modules which extend the functionality of Wordpress or Drupal websites, giving more features to the system than what's available out of the box. For example it's typical for a Drupal site to install Views to support building fancy data displays, and on (longtailpipe.com) my Wordpress blog I've added the PODS Framework to simplify defining custom post types along with custom fields.

Where should you put routes in an Express/Node.js web application for simple easy coding enjoyment?

(2015-06-09 15:20)

The Express.js app framework for Node.js is a pretty cool system that makes it easy to implement web apps and even REST API's. But the Express team doesn't give you any guidance on structuring the application code. They give you an API and it's up to you to decide how or even if you structure the model-view-controller paradigm or any other paradigm you wish to use.

Safely detect if a Node.js module is installed before using require() to load it

(2015-05-05 17:20) Sometimes you need to detect whether a Node.js module is installed, and print a useful error message if it isn't. For example Grunt does this. The instructions are to install "grunt-cli" then add "grunt" to the package.json for the project for which you want to use Grunt. If you haven't installed grunt locally, typing "grunt" gives you a nice error message telling you what to do. It does that instead of printing an ugly message from the "require" function saying your module wasn't loaded.

Easily deploy files or directory hierarchies to a server using Grunt

(2015-03-03 12:36) Something we geeks need to do all the time is deploy files between machines. Such as, deploying a directory hierarchy over to a server for staging or production use. There's a ton of ways to do this. The old-school way is a shell script with carefully crafted rsync commands. In my case I build websites using (akashacms.com) AkashaCMS and need to deploy them to the destination webserver. Until now I'd added a command to AkashaCMS solely for deployment, but I'm experimenting with Grunt to see how much can be done using the Grunt ecosystem rather than having to maintain code in AkashaCMS.

Don't rip your hair out when Vows tells you "Errored callback not fired" - try this one weird trick instead

(2015-01-07 18:10)

When your vows.js based tests for a Node.js application says "Errored » callback not fired" -- well, it can be very confusing. In my case the code clearly handled all paths ensuring the Vows callback would be called. No matter how many tweaks I performed to try and catch some possible error in test or code, I couldn't figure out what caused this problem. But after some yahoogling, the answer was not only difficult to find, but surprisingly simple.

Distributing, publicly or privately, Node.js modules without using npm repository

(2014-09-07 11:51) The default assumption for distributing a Node.js module is to publish it in the public npm registry. It's a simple declaration in the package.json, and then you tell your customers to simply type "npm install". The public npm registry takes care of the details, and you can even use versioning to make sure your customers use tested module versions. But what if you don't want to publish modules in the public npm registry? Maybe your modules are proprietary, or maybe the modules are too intertwined with a parent product to be of general use?

How do you choose between Node.js or other web application technologies?

(2014-09-06 11:38)

There are plenty of new server side web application development technologies being developed. With the blizzard of choices before us, how do you choose between one or another? Will the newly hot web app technology really take off, or will it fizzle in a few years? For example, Node.js is getting a lot of excitement, but what about Go, or what about the mature platforms like PHP/Symfony or CakePHP?

Easily offload your CPU-intensive Node.js code with simple Express-based REST server

(2014-07-03 23:47)

Node.js is horrible with CPU bound processing, supposedly. Why? Because CPU-intensive algorithms block the event loop from handling events, blocking the Node.js platform from doing its core competency. Actually, as I demonstrate in my book Node Web Development (see sidebar for link), it's possible to use "setImmediate" to dispatch work through the Node.js event loop, and perform intensive computation while not blocking the event loop. The example I chose for the book is a simplistic Fibonacci algorithm, and requesting "large" Fibonacci values (like "50") would take a loooong time. But, by recoding the Fibonacci algorithm using setImmediate, it can do calculation for any Fibonacci value without blocking the event loop.

Unit testing Express route handlers in isolation from everything, including Express

(2014-06-07 23:48)

When we write unit tests it's good practice to "mock" out extraneous bits to the code being tested. It's almost like the scientific method in that testing, in the unit testing paradigm, means exercising each small portion of your code in isolation if only to eliminate unwanted variables. While there are other testing paradigms, unit testing has its value. A big question for Node.js web application programmers is - how do you mock out HTTP requests for unit testing? In other words, how do you test the route handler method in isolation from the Node.js HTTPServer object, or Express, or whatever app framework used in your application?

Avoid tearing your hair out on variable values in deeply nested JavaScript/Node.js callback chains

(2014-05-22 14:51)

JavaScript, and hence Node.js, supports a useful model for variable scoping and callback functions where the available variables build up as the code nests. It's very convenient because your code doesn't have to pass values through function parameters to code in an in-line callback function. But it's possible for a variable to not have the expected value by the time the callback function executes. When that's the case, it's tempting to start tearing your hair out in frustration screaming about the variable's value is incorrect. The culprit can be that the code is executing asynchronously even though it looks like linear code.

Is there a way to pass variables down to a nested callback without passing them to each function along the way, unnecessarily?

JavaScript doesn't tell you the Date object is bad, here's how to figure that out before crashing your program

(2014-05-04 21:41)

In JavaScript, creating a Date object from a string is real convenient ("var foo = new Date(dateString)"), but what if dateString has a bad format? How will your code know about this? The Date object doesn't have a getter to tell you the date is bad.

In (akashacms.com) AkashaCMS I just added a feature so the website author can set the file date using metadata in the content. Previously the file date was set from the date code on the input file, but of course that's probably not accurate. It's better if the website author can specify the date they want to appear in the website, and as the file date.

Installing MongoDB on Mac OS X Mavericks for Node.js development

(2014-01-17 14:49) How do you upload files to a server to deploy application or website code?  FTP?  rsync?  While it's easy enough to call a command line tool like rsync from a Node.js script, what if you're using a Windows computer that doesn't have those command line tools.  When I use Windows it's like stepping back into the dark ages where directory listings looked like we were making fire by rubbing sticks together.  Okay, there does appear to be an rsync for Windows but I had no confidence in it.  Also, I did not want to have a dependency on something like Cygwin.

Managing Node.js servers on Mac OS X with forever - works best for development

(2014-01-03 17:07) If, like me, you're doing Node.js development on a Mac, you might have a yearning for a tool like MAMP but which works for Node.  A couple weeks ago I wrote a blog post covering the first step, (nodejs.davidherron.com) setting up a Node and npm instance on your computer.   If you don't know what MAMP is, go read that blog post, and then come back here.  What I want to go over today is a way to manage/monitor one or more Node processes on your computer.

How do function(err,data) callbacks work in Node?

(2013-12-17 17:38) Those new to Node programming might find the callback function pattern a little difficult to understand.  For example how does the data get into the arguments to the function call, and how does the callback function get called?

Node.js is a big win at PayPal

(2013-12-17 16:47)

In my book Node Web Development (see sidebar), I spent the first chapter trying to sell the reader on using JavaScript on the server.  That's because the typical server side languages do not include JavaScript, meaning everyone has to be scratching their head and wondering why they should use JS on the server.  I suggested that, theoretically, one big win will come because the front end coding and back end coding will both be in the same language, JavaScript, which will make it possible for front engineers to talk with server engineers in the same language.  Or perhaps even be the same person.

How to generate unique temporary file names in Node

(2013-12-17 16:35)

Often we want to write data to a file, don't really care what the file name is, but want to be sure our code is the only code accessing that data.  A trivial algorithm might be to form a file name like:

MacOS X setup for Node.js development - Installing Node

(2013-12-09 19:11) I'm setting up a new Mac, rather, I'm doing a clean install of my Mac Mini as a way to upgrade to Mavericks.  I've had the Mini since 2009 and the disc has some cruft so I thought it would be best to start with a clean slate.  That means reinstalling EVERYTHING including all the stuff I use for Node.js development. Hence, the idea came to mind that this would be a useful starting point for a series of blog posts.  I've always wondered what it would take to set up the Node.js equivalent to the MAMP application.

How to get URL params after '?' in Express.js or Node.js?

(2013-06-09 11:38)

Express makes it easy to route parameterized URL's to a handler function, and easily grab data out of the request URL.  This makes it easy to build a web application, that puts data into the URL, with clean URL's out of the box.  That's so much nicer than other application frameworks that require abominations like mod_rewrite to get clean URL's.  However nice the parameterized URL's are in Express, they do not handle other parts of the URL such as query parameters (the part of the URL after the '?').

A brief look at Sequelize, an ORM for Node.js with MySQL, PostgreSQL or SQLITE3

(2013-03-25 22:02) Want to do some database code but not think too much about it?  Such as, avoid SQL?  You can have your SQL and a simplified model of your database thanks to a module I just found for Node.js called Sequelize.  It adds an ORM-like layer on top of MySQL, PostgreSQL or SQLITE3, allowing you to do database interactions using JavaScript code rather than SQL.  It's fairly nice and easy to use, however I think it's likely there are some limitations to the complexity of what you can do with Sequelize.

Uploading/mirroring files to remote server in Node.js without using rsync

(2013-02-12 00:39) How do you upload files to a server to deploy application or website code?  FTP?  rsync?  While it's easy enough to call a command line tool like rsync from a Node.js script, what if you're using a Windows computer that doesn't have those command line tools.  When I use Windows it's like stepping back into the dark ages where directory listings looked like we were making fire by rubbing sticks together.  Okay, there does appear to be an rsync for Windows but I had no confidence in it.  Also, I did not want to have a dependency on something like Cygwin.

Node v0.8.17 released - fixes security vulnerability - we're urged to upgrade ASAP

(2013-01-09 20:07) Isaac Schlueter just posted this warning ..

Implementing rsync or sftp in Node.js to synchronize files?

(2013-01-01 19:39) How do you accomplish synchronizing a directory tree of files to a server?  For example (akashacms.com) AkashaCMS, my newly developed tool for building static websites, it builds a directory structure containing all the files for the website.  The question I've been pondering for awhile is, what's the best way to get those files over to the web server?  I've been using scp -r, and have also played with using rsync, and just integrated rsync into the AkashaCMS scripts.  But, I'm not seeing a great solution-set available, especially because this needs to run on my girlfriend's computer, and she is a Windows user and therefore does not have rsync available, I need a solution.

Crunching/minifying HTML, CSS and JavaScript in Node.js with the minify module

(2013-01-01 12:33)

I've just added HTML/CSS/JavaScript minification to AkashaCMS (link is external), to minimize the size of static website files rendered by AkashaCMS. This will reduce page load times by decreasing the number of bytes required to be downloaded. We humans like blank space because spreading out information makes it easier to understand. With programming languages that becomes all the white space and indenting conventions. But the white space makes no difference to the computers that interpret the web pages, in fact it makes the web browsing experience slower because it takes longer to download or execute the web pages, or the CSS or JavaScript referenced by the web pages.

What's the best open source license for Node.js modules ??

(2012-12-19 11:24) I've been developing a new software project with Node.js, a (akashacms.com) "content management" system that produces static HTML websites named AkashaCMS.  Last week I made my initial release into npm and knew I needed to put an open source license on the code, and by default I put in the GPL license.  But then I thought to ponder, is the GPL the best choice of license?  Will that license prevent others from using AkashaCMS?  In general, what's the best license for a Node.js open source project?  Does use of a Node module invoke the viral nature of the GPL and infect GPLness into modules that use the GPL'd module?  I didn't think about this myself, but would the GPL license interfere with others who want to contribute patches?  So I sent a query to the Node.js group on Google Groups (linked below), which touched off an insightful conversation.

Overriding console.log in Node.js, and other thoughts about logging in Node apps

(2012-08-06 22:57)

How should Node.js programs best do logging?  When that question came up in the (groups.google.com) node users mailing list, Tim Caswell answered to just use console.log, and if you want to send the log to somewhere other than stdout then to override the function.  That makes the Java programmer recoil with "eeew, overriding a system function is wrong" but hey we're in a JavaScript environment.  This sort of thing is par for the course in JavaScript.  So, how do you go about doing this?

Simple data export and manipulation using Node.js and the node-mysql module

(2012-07-10 16:04) What follows is a fairly simple data processing script to extract data from a Drupal installation in a MySQL database. The purpose was to export nodes from a Drupal site, reformatting them for some software I'd written to import content into a blogger blog. In other words, this is the sort of simple data extraction and manipulation tool we write all the time.

Potential for integrating Node.js with Drupal and speed up Drupal page processing

(2012-02-17 16:16) Besides some experience with Node.js, enough to write the book linked in the side bar, I've also spent a lot of time building and configuring Drupal websites.  I've been pondering the possibilities for marrying Node with Drupal and have also seen a few projects spring up with that purpose.  However the core issue is that Drupal page processing is not an asynchronous process like Node's query handling, instead Drupal implements the typical synchronous start at the beginning and go to the end step by step model.  You know, the model we're trying to get away from by adopting Node.

JavaScript or SQL injection attacks in the Node.js platform?

(2011-12-21 14:24)

Traditionally the server side of web applications has been written in PHP, Perl, Python, Java, C/C++, etc. Javascript traditionally was implemented only in web browsers, and hence Javascript programming has been almost completely focused on the client end of web application development. It's arguably better to have the same programming language on both client and server sides of web application development, maybe. Several attempts have been made to implement javascript for server side web application development. A new javascript stack, Node.JS, is getting a lot of attention.

Getting image metadata using the Node.js imagemagick module

(2011-11-03 21:27)

Continuing on in my quest for Node.js scripts to manipulate images (see my earlier JPG to PNG conversion script), today I'm looking at how to access image metadata. The result I'm interested in is to store a caption, keywords and other information in the image itself and to display the caption and keywords on web pages. I found it pretty easy to add a caption and keywords and other metadata using Picasa.

Convert JPG's into PNG's using Node.js and ImageMagick - Possible Photo workflow?

(2011-10-30 22:09)

I'm pondering a new photography workflow where, instead of working with the JPG's directly out of the camera, that I instead convert them to PNG first.  The reasoning is that JPG is a lossy image format meaning every time you edit a JPG it loses a bit of precision, whereas PNG is a lossless image format and you don't lose precision.  That idea might not be the best, I haven't checked how well Picasa works with PNG's, in any case it let me play with what kind of image manipulation we can do in Node.js.

Ryan Dahl: History of Node.js

(Oct 5, 2011) In this talk, Ryan Dahl gives an expansive history of Node.js, not just the technological history but his personal history leading to developing Node.js. As a Mathematics PhD student in up-state New York, he had a "what the f**k am I doing" moment, dropped out of the program, and moved to Chile and ended up writing PHP websites. One thing led to another, and he became embroiled in the question of why Rails is so slow and doesn't scale well. And that led to the realizations leading to developing Node.js as a single threaded system relying on asynchronous code execution.

Is Node.js a cancer? No!! It's quite nice, really

(2011-10-02 18:24)

A recent blog post by Ted Dziuba claims that Node.js "is a cancer" and fills out a few hundred words of inflammatory laden "proof" to make his point. The post makes a few good points but is largely off base. Perhaps the most sticking point is that CPU intensive tasks make Node servers become unresponsive, but I have a clever answer for him. Another issue he raises ("JavaScript sux") is, well, as a longtime Java programmer who used to work in the Java SE team at Sun, I've had my own moments like that, but really JavaScript is quite a nice language especially if you stick to the good bits of JavaScript.

Ryan Dahl: Introduction to Node.js Ryan Dahl's presentation at Yahoo

(Sep 22, 2011) In May 2010, Yahoo held a meeting billed as Cinco de Node.js, and Ryan Dahl gave this presentation about Node.js.

Deploying a Node.js application in place of a "real" webserver

(2011-07-18 18:26) Node.js is an exciting new software stack for developing web applications, or a server implementation for any other sort of network protocol. Perhaps most will see its primary use in deploying web applications accessed like any other web applications such as the traditional LAMP/PHP approach. The obvious question then is what's the best way to deploy a Node.js web application. Indeed, this very question was asked today over on Quora.com.

Node.js and Bell's Law of computer classes

(2011-07-15 11:28)

Node.js offers us an exciting new model for developing web applications and a statement in a recent episode of the TWiT Network's Triangulation podcast gave me an interesting lens through which to interpret the excitement around this new thing. That episode featured an interview with Gordon Bell, formerly the VP of Engineering at Digital Equipment Corporation, a company which at the time (1972) was revolutionizing the computer industry from being dominated by Mainframes to being dominated by Minicomputers. DEC's reason for existence was to develop and promote Minicomputers, but they were later supplanted by the Microcomputer era and DEC was unable to make the transition and later died. Gordon Bell is currently a researcher at Microsoft. He spoke about many things during the interview, he has over 40 years experience in developing key aspects of the computer industry, and his discussion about Bells Law struck me as a very apt way to describe the excitement around Node.js.

Joyent webinar on Node.js and "Carriers" (?phone companies?)

(2011-07-14 12:28)

Recently the primary supporter of Node.js, Joyent, posted a video webinar about "Node.js overview for Carriers". Eric Burns talked about a broad range of services offered by Joyent, features of Node.js, spinning it all around the needs of mobile device carriers. That is, the phone companies who provide mobile device services and run the cell phone networks, not those individuals who carry around mobile devices.

Could Node.x unseat Node.js? Event driven asynchronous server side platform duel in the making?

(2011-07-11 16:25) Node.js is getting a lot of excited attention, but is it the only way to build an event driven server? For example the other day I summarized some work by Twitter to re-architect their systems including an event driven asynchronous server, but that server was written in Java and in general the article proved that a single-language solution like Node.js might not be the best because there are plenty of useful languages besides JavaScript (see Java, Twitter, and asynchronous event driven architecture). Today on Twitter I saw an announcement of Node.x, which is a general purpose framework for asynchronous event driven programming but rather than built on top of Node.js/V8 it's built on top of the JVM. And by being on top of the JVM it immediately opens the door to a multi-language solution, where Node.js is a single language solution.

Java, Twitter, and asynchronous event driven architecture

(2011-07-08 09:36)

I'm reading a blog post about what Node.js is, and there's a glaring question "why in the world would anyone want to run JavaScript outside of a browser, let alone the server?" As the author of a (www.amazon.com) book about Node.js it's a question I've thought about quite a bit, especially coming as I do from the Java SE team at Sun where the work of that team was highly focused on server side software (hey, it's Java) to the detriment of the client side of Java. The question comes from a belief cemented into place by 15+ years of JavaScript in the browser that it's a browser only language. However, JavaScript has a long history on server-side and is a rather cool language, and Node.js is an excellent base for developing web applications.

Java, Twitter, and asynchronous event driven architecture

(2011-07-08 09:36)

Twitter famously launched using the then-popular Ruby on Rails web framework. Since then they suffered scalability problems which they famously made light of with the Fail Whale. Word has been that they started using Scala a while back, and it turns out they've been doing an intense study of methods to scale their service to handle the traffic volume they've been facing. A recent article on InfoQ went over some of the things they did, and surprisingly they did not use any Node.js software.

Nodeload - highly flexible performance and load testing for Node.js

(2011-06-01 14:28) HTTP load/traffic generator and benchmark tool built on Node.js

What might the excitement about Node.js be about? JavaScript on the server? Events? Or, what?

(2011-05-27 19:16) There's a lot of excitement brewing around Node.js with a rapidly growing community of people and projects surrounding the platform, and at least five books either published or on their way to being published. I myself am working in a team at a company I cannot yet name on a large Node.js project that could be very significant. The team is excited about the platform but also have some real eyes on the question of whether this makes sense for the company, or what. I thought it would be interesting to run through some attributes of Node.js and ponder what might or might not contribute to the excitement about Node.js and its eventual success. I'm also interested in what others think, so consider leaving your thoughts below.

COMET as a justification for using Node.js?

(2011-05-03 13:41) A lot of excitement is circulating around Node.js. To an extent this strikes me as symptomatic of a pattern in internet software development where a flashy new idea comes along, a bunch of leading edge thinkers get excited and start using and promoting it, there's a wave of excitement, and a call to rewrite everything under the sun using this new bit of flashy technology. But is the reinvestment of rewriting everything using that new piece of technology worth the result? That is, will Node.js be the death of LAMP? Who knows about whether the excitement around Node.js will lead to that result, but in researching and evaluating Node.js I've come across a specific use case that directly calls for server architecture identical with Node.js. There's an exciting class of web applications which use asynchronous browser updates to increase interactivity, that as we'll see in a minute require an event driven server architecture which seems well suited to Node.js. Leaving aside the question of a general purpose Node.js based server stack, let's look at COMET style applications.

Node.js: JavaScript on the Server - Ryan Dahl's original presentation at Google

(2011-05-02 18:07) The following is the original presentation by Ryan Dahl showing the ideas behind Node.js and some of the performance results which have wow'd people.

Fargo: a Scheme for Node.js? Node.js supports only one language!

(2011-05-02 17:46) The guys who developed Node.js implemented it on top of a virtual machine which supports only one programming language - JavaScript. If they'd wanted us to use multiple programming languages they could have implemented Node.js on top of the Java/Hotspot VM and it's rich and mature support for multiple languages. But they didn't. There are a couple examples of "other" languages being used to write Node.js programs, such as CoffeeScript.

Is Node.js one of the most widely used scripting languages on the Internet? Really?

(2011-03-31 20:21) I can believe JavaScript is one of the most widely used scripting languages, but Node.js? Huh? But, over there on embed.ly they have published two libraries implementing the embed.ly API for PHP and Node.js, and claimed "These two libraries give you server-side access via the two most widely used scripting languages today."

Javascript (specifically Node.JS) for server-side web application programming

(2010-11-15 10:54)

Traditionally the server side of web applications has been written in PHP, Perl, Python, Java, C/C++, etc. Javascript traditionally was implemented only in web browsers, and hence Javascript programming has been almost completely focused on the client end of web application development. It's arguably better to have the same programming language on both client and server sides of web application development, maybe. Several attempts have been made to implement javascript for server side web application development. A new javascript stack, Node.JS, is getting a lot of attention.

2016 Election Acer C720 Ad block AkashaCMS Amazon Amazon Kindle Amiga Android Anti-Fascism Apple Apple Hardware History Apple iPhone Apple iPhone Hardware April 1st Arduino ARM Compilation Astronomy Asynchronous Programming Authoritarianism Automated Social Posting Ayo.JS Bells Law Big Brother Big Finish Black Holes Blade Runner Blogger Blogging Books Botnet Botnets Cassette Tapes Cellphones Christopher Eccleston Chrome Chrome Apps Chromebook Chromebooks Chromebox ChromeOS CIA CitiCards Citizen Journalism Civil Liberties Clinton Cluster Computing Command Line Tools Computer Hardware Computer Repair Computers Cross Compilation Crouton Curiosity Rover Cyber Security Cybermen Daleks Darth Vader Data backup Data Storage Database Database Backup Databases David Tenant DDoS Botnet Detect Adblocker Developers Editors Digital Photography DIY DIY Repair DNP3 Docker Doctor Who Doctor Who Paradox Drobo Drupal Drupal Themes DVD E-Books E-Readers Early Computers Election Hacks Electric Bicycles Electric Vehicles Electron Emdebian Energy Efficiency Enterprise Node EPUB ESP8266 Ethical Curation Eurovision Event Driven Asynchronous Express Facebook Fake News Fedora VirtualBox File transfer without iTunes FireFly Fraud Freedom of Speech Gallifrey git Gitlab GMAIL Google Google Chrome Google Gnome Google+ Government Spying Great Britain Heat Loss Hibernate Home Automation HTTPS I2C Protocol Image Analysis Image Conversion Image Processing ImageMagick InfluxDB Infrared Thermometers Insulation Internet Internet Advertising Internet Law Internet of Things Internet Policy Internet Privacy iOS Devices iPad iPhone iPhone hacking Iron Man Iternet of Things iTunes Java JavaScript JavaScript Injection JDBC John Simms Journalism Joyent Kindle Marketplace Lets Encrypt LibreOffice Linux Linux Hints Linux Single Board Computers Logging Mac OS Mac OS X MacOS X setup Make Money Online MariaDB Mars Matt Lucas MEADS Anti-Missile Mercurial Michele Gomez Micro Apartments Military Hardware Minification Minimized CSS Minimized HTML Minimized JavaScript Missy Mobile Applications MODBUS Mondas MongoDB Mongoose Monty Python MQTT Music Player Music Streaming MySQL NanoPi Nardole NASA Net Neutrality Node Web Development Node.js Node.js Database Node.js Testing Node.JS Web Development Node.x North Korea Online advertising Online Fraud Online Journalism Online Video Open Media Vault Open Source Governance Open Source Licenses Open Source Software OpenAPI OpenVPN Personal Flight Peter Capaldi Photography PHP Plex Plex Media Server Political Protest Postal Service Power Control Privacy Production use Public Violence Raspberry Pi Raspberry Pi 3 Raspberry Pi Zero Recycling Remote Desktop Republicans Retro-Technology Reviews Right to Repair River Song Robotics Rocket Ships RSS News Readers rsync Russia Russia Troll Factory SCADA Scheme Science Fiction Season 1 Season 10 Season 11 Security Security Cameras Server-side JavaScript Shell Scripts Silence Simsimi Skype Social Media Warfare Social Networks Software Development Space Flight Space Ship Reuse Space Ships SpaceX Spear Phishing Spring Spring Boot SQLite3 SSD Drives SSD upgrade SSH SSH Key SSL Swagger Synchronizing Files Telescopes Terrorism The Cybermen The Daleks The Master Time-Series Database Torchwood Total Information Awareness Trump Trump Administration Ubuntu UDOO Virtual Private Networks VirtualBox VLC VNC VOIP Web Applications Web Developer Resources Web Development Web Development Tools Web Marketing Website Advertising Weeping Angels WhatsApp Window Insulation Wordpress YouTube