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

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

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.

Click here for more Node.js programming advice

Examiner.com writers can save their work using this screen-scraper script written for the purpose

I've been writing for Examiner.com for over 7 years, and with the news that they're going to shut down I needed to retrieve over 540 articles to repost them on my own website. Lesson learned - it's better to own your own platform than to write for someone elses platform. Anyway, the result is a Node.js script I'm calling articlescraper. The purpose is to traverse an index page that might be split over multiple pages, then extract the articles from the pages linked from the index.

The demise of examiner.com, what's it mean for citizen journalism?

examiner-logo-blue.jpgIt wasn't that long ago that online news sites began killing off the traditional news services. Many newspapers and magazines have either shut down (costing many cities a vitally necessary check on local government), or else shrank, or else transitioned to an online service. A generation of writers and journalists are under turmoil in a time period where we desperately need a check on the powerful elite.

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

nodejs-dark.pngSince 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.

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

nodejs-dark.pngNode.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.

Drupal Book node hierarchy went missing, necessitating database patching and a couple scripts to help

Twice now I've had the Book hierarchy on a Drupal 6 site go bonkers. The first time was on this very site, back in 2009, while this site was being converted from Drupal 5 to Drupal 6 (it's now on Drupal 7). The /book page simply became empty, and I managed to fix the book hierarchy with some database twiddling. That was over six years ago and I'd since converted this site to Drupal 7. I have another site still running Drupal 6, and the same problem (empty /book page) just happened on that site.

Ensuring your Wordpress filter affects text generated by a shortcode

wordpress-logo-stacked-rgb.pngSuppose you've developed a Wordpress plugin to expand a shortcode. That's easy enough, the Shortcodes API is straightforward enough and it's pretty simple to do.

Ensuring custom post types show up on Wordpress categories & tags archive pages

wordpress-logo-stacked-rgb.pngThe default behaviors built into Wordpress drive me batty sometimes, because they've made certain assumptions that aren't always right. One of these are that the built-in Categories and Tags taxonomies are somehow special. In particular if you create a custom post type, then associate that post type with either Categories and Tags, the category or tag archive pages won't show posts for your custom post type.

Embed an Amazon aStore on Wordpress with a functional URL that accepts ASIN etc arguments

wordpress-logo-stacked-rgb.pngThrough the Amazon affiliate program you can create what's called an Amazon aStore - which is a functional "store" filled with products you specify from the Amazon website, that then earn you affiliate commissions. You curate the products shown on your store, and presumably that'll be what makes your store more valuable is the effort you take to select appropriate products for your audience.

Pages

Subscribe to Front page feed