Below you can find RisingStack's collection of the most important Node.js news, projects & updates from this week:
Nightwatch.js enables you to "write end-to-end tests in Node.js quickly and effortlessly that run against a Selenium/WebDriver server".
- End-to-end testing is part of the black-box testing toolbox. This means that as a test writer, you are examining functionality without any knowledge of internal implementation.
- End-to-end testing can also be used as user acceptance testing, or UAT. UAT is the process of verifying that the solution actually works for the user.
Daniel Khan has a 17 year long web development carrier behind him, so he decided to share his insights during NodeConfBP (RisingStack's Node.js Conference).
A few insights:
- History repeats itself and the tech industry is most likely heading towards another crash - so developers must prepare themselves.
- The Broken Windows theory fits well with coding, so remember to always write code for your future self!
- You shouldn't jump on a latest fashionable JS framework bandwagon all the time.
- The module system is kind of broken, there are hundreds of modules solving the same problem. It's hard to figure out what to use.
- Information on StackOverflow is often wrong, don't blindly copypaste code from there!
And so on..
Today, we’re excited to announce that npm Orgs, our collaboration tool for helping teams manage permissions and share their code, is free for all developers of open source packages. You may invite an unlimited number of collaborators to manage an unlimited number of public packages for $0.
Slack bots — they’re fun, they’re useful, and people are building new businesses around bot interaction models on a daily basis.
StdLib is a Function as a Service software library. The easiest way to think of it is to imagine if AWS Lambda and GitHub had a child, then asked NPM and Twilio to be the godparents — scalable microservices with no server administration, easy command line management, version immutability, service discovery, and the ability to charge customers for premium services you’ve built on a per-request basis.
When Node invokes that require() function with a local file path as the function’s only argument, Node goes through the following sequence of steps:
- Resolving: To find the absolute path of the file.
- Loading: To determine the type of the file content.
- Wrapping: To give the file its private scope. This is what makes both the require and module objects local to every file we require.
- Evaluating: This is what the VM eventually does with the loaded code.
- Caching: So that when we require this file again, we don’t go over all the steps another time.
In this article, I’ll attempt to explain with examples these different stages and how they affect the way we write modules in Node.
Latest Node.js Releases
IMPORTANT: This Node.js Version became the default on Amazon Lambda!
- performance: The performance of several APIs has been improved.
Buffer.compare()is up to 35% faster on average.
buffer.toJSON()is up to 2859% faster on average.
fs.*statSync()functions are now up to 9.3% faster on average.
os.loadavgis up to 151% faster.
process.memoryUsage()is up to 34% faster.
querystring.unescape()for Buffers is 15% faster on average.
querystring.stringify()is up to 7.8% faster on average.
querystring.parse()is up to 21% faster on average.
- IPC: Batched writes have been enabled for process IPC on platforms that support Unix Domain Sockets.
- Performance gains may be up to 40% for some workloads.
spawnSyncnow returns a null
statuswhen child is terminated by a signal.
- This fixes the behavior to act like
- Control characters are now always rejected when using
- Debug messages have been added for cases when headers contain invalid values.
- node: Heap statistics now support values larger than 4GB.
- timers: Timer callbacks now always maintain order when interacting with domain error handling.
- deps: Add node-inspect 1.10.6
- inspector: proper WS URLs when bound to 0.0.0.0
- tls: fix segfault on destroy after partial read.
Previously in the Node.js Weekly Update
In the previous Node.js Weekly Update we read fantastic articles about Serverless Node, a new course on Using npm scripts, Client-side routing, Concurrency in Node + v7.7.3 Released was released as well!