Now is a great time to invest in yourself, or in your engineering team. Starting November 30 through December 8, the OpenJS Foundation, in partnership with the Linux Foundation, will be discounting all Node.js Certifications and Trainings. The OpenJS Certification and Training program serves to help developers in their professional development goals.
Certifications are excellent ways to validate your own development skills to yourself, employers, and the world.
OpenJS Node.js Application Developer (JSNAD) The OpenJS Node.js Application Developer certification is ideal for the Node.js developer with at least two years of experience working with Node.js. For more information and how to enroll: https://training.linuxfoundation.org/certification/jsnad/
OpenJS Node.js Services Developer (JSNSD) The OpenJS Node.js Services Developer certification is for the Node.js developer with at least two years of experience creating RESTful servers and services with Node.js. For more information and how to enroll: https://training.linuxfoundation.org/certification/jsnsd/
Feel confident in taking your exams with the Node.js Training courses. These courses help prepare developers for the Node.js certification exams.
Node.js Application Development (LFW211) This course provides core skills for effectively harnessing a broad range of Node.js capabilities at depth, equipping you with rigorous skills and knowledge to build any kind of Node.js application or library. While by design the training content covers everything but HTTP and web frameworks, the crucial fundamentals presented prepares the student to work with web applications along with all types of Node.js applications.
Node.js Services Development (LFW212) This course provides a deep dive into Node core HTTP clients and servers, web servers, RESTful services and web security essentials. With a major focus on Node.js services and security, this content is an essential counterpart to the Node.js Application Development (LFW211) course, and will prepare you for the OpenJS Node.js Services Developer (JSNSD) exam.
If you’d like to pursue Node.js Certifications and Trainings and this sounds like something you’d like to know more about, check out more information at this link.
N-API provides an ABI-stable API that can be used to develop native add-ons for Node.js, simplifying the task of building and supporting such add-ons across Node.js versions.
With downloads of node-addon-api surpassing 2.5 million per week, all LTS versions of Node.js supporting N-API version 3 or higher and node.js 15.x being released with support for N-API 7, it is a good time to take a look at the progress on simplifying native add-on development for Node.js.
When we started working on N-API back in 2016 (the original proposal is 12 Dec 2016) we knew it was going to be a long journey. There are many native packages in the ecosystem and we understood the transition would take quite some time.
The good news is that we have come a long way since the initial proposal. There has been a lot of work by the Node.js collaborators and the team focussed on N-API as well as package authors who have moved over. In that time, N-API has become the default recommendation for how to build native add-ons.
While the basic design has remained consistent (as planned), we’ve added incremental features in each new N-API version in order to address feedback from package authors as they adopted N-API and node-addon-api.
Having said that, let’s dive into some of the new features/functions that have been added over the last few years.
As people have been using N-API and node-addon-api we’ve been adding the key features that have been needed, including generally improving the add-on experience.
The changes fall into 3 main categories which are covered in the sections which follow.
Multi-Threaded and Asynchronous Programming
Performing computationally-intensive tasks on the main thread will block program execution, queuing events and callbacks in the event loop. As we gained experience with real-world use, in order to facilitate program integrity across multiple threads, both N-API and its wrapper node-addon-api were updated to provide several mechanisms to call into the Node.js thread from outside the main event loop, depending on use-case:
AsyncWorker: provides a mechanism to perform a one-shot action, and notify Node.js of its eventual completion or failure.
AsyncProgressWorker: similar to the above, adding the ability to provide progress updates for the asynchronous action.
Thread-safe functions: provides a mechanism to call into Node.js at any time from any number of threads.
Another recent Node.js development is the arrival of workers. These are full-fledged Node.js environments running in threads parallel to the Node.js main thread. This means that native add-ons can now be loaded and unloaded multiple times as the main process creates and destroys worker threads.
Since threads share the same memory space as the main process, multiple copies of a native add-on must now be able to co-exist in a single process. On the other hand, the library containing a native add-on is only loaded once per process. Thus, global data stored by a native add-on, which was so far stored in global variables, must no longer be stored in such a way, because global storage is not thread-safe.
Static data members of C++ classes are also stored in a thread-unsafe manner, so those must also be avoided. It’s also important to remember that the thread is not necessarily that which makes an add-on instance unique. Thus, thread-local storage of global variables should also be avoided.
In N-API version 6 we started providing a space for storing per-instance global data by introducing the concept of add-on instances, multiple of which can co-exist in a process, and by providing some tools for creating self-contained add-ons, such as
the NAPI_MODULE_INIT()macro, which will initialize an add-on in such a way that it can then be loaded multiple times during the life cycle of the Node.js process.
The node-addon-api Addon<T> class, which neatly combines the above tools to create a class whose instances represent instances of an add-on present in the various worker threads created by Node.js. Thus, add-on maintainers can store per-add-on-instance data as variables in an instance of the Addon<T> class and Node.js will create an instance of the Addon<T> class whenever it is needed on a new thread:
Additional helper methods
As package maintainers used N-API we discovered a few additional APIs that were commonly needed. These included:
Retrieving property names from objects
One of the other main areas where the N-API team worked to fill in gaps and make it easier for maintainers to consume N-API was the build workflow, including additions to CMake.js, node-pre-gyp and prebuild.
Historically, Node.js native addons have been built using node-gyp. For source code libraries that are already being built using CMake, the CMake.js build tool is an attractive alternative for building Node.js native add-ons. We have recently added an example of an add-on built using CMake.
Detailed information about using CMake.js with N-API add-ons can be found on the N-API Resource.
One of the realities of developing Node.js native add-ons is the fact that as part of installing the package using npm install the C or C++ code must be compiled and linked. This compilation step requires that a viable C/C++ toolchain be installed on the system doing the compilation. This can present a barrier to the adoption of native add-ons as the user of the add-on may not have the necessary tools installed. This can be addressed by creating prebuilt binaries that can be downloaded by the user of the native add-on.
A number of build tools can be used to create prebuilt binaries. node-pre-gyp builds binaries that are typically uploaded to AWS S3. prebuild is similar to node-pre-gyp but uploads the binaries to a GitHub release.
prebuildify is another option similar to the above that enables the native add-on developer to bundle the prebuilt binaries into the module uploaded to npm. The advantage of this approach is that the binaries are immediately available to the user when the package is downloaded. Although the downloaded npm package is larger in size, in practice the entire download process is faster for the user because secondary download requests to AWS S3 or a GitHub release are unnecessary.
Resources for getting started
One resource available to help get started is the node-addon-examples GitHub repository, containing samples of various Node.js native add-ons. The root of the repository contains folders for different functional aspects, from a simple Hello World add-on to a more complex multi-threaded add-on. Each example folder contains up to three subfolders: one for each Node.js add-on implementation (legacy NAN, N-API, and node-addon-api). To get started with the Hello World example using the node-addon-api implementation, simply run:
Another resource available is the The N-API Resource. This website contains information and additional in-depth walkthroughs regarding building Node.js add-ons and other advanced topics, such as:
tools needed to get started
migration guide from NAN
differences between build systems (node-gyp, cmake, …)
context-sensitivity and thread-safety
Closing out and call to action
The resulting C API is now a part of every Node.js distribution and a C++ convenience wrapper called node-addon-api is distributed as an external package through npm. N-API was launched with the promise to guarantee the API and the ABI compatibility across different major versions of Node.js and this has introduced a series of benefits:
It has removed the need to recompile modules when migrating to newer major versions of Node.js
Since N-API is a C API it is possible to implement native add-ons using languages other than C / C++ (such as Go or Rust).
When N-API has been released as an experimental API in Node.js v8.0.0 its adoption started to grow slowly, but many developers started to send feedback and contributions and this led us to add new features and to create new tools to better support all the native add-ons ecosystem.
Today N-API is widely used for the development of native add-ons. Some of the most used native add-ons have been ported to N-API:
We are constantly making progress on N-API and in general on the native add-ons ecosystem, but we always need more help. You could help us and the whole community to continue improving N-API in many ways:
Porting your own native module to use N-API
Porting a native module that your app depends on to N-API
The Dojo Project joined the OpenJS Foundation for an AMA on YouTube on November 9th, 2020. The AMA aimed to share insight into the Dojo Project from inception to beyond the current application. Dojo co-creator Dylan Schiemann moderated the AMA with Anthony Gubler, co-maintainer and architect of current Dojo. In this AMA, users were able to ask questions via Twitter and live YouTube chat.
Questions ranged from how Dojo has been iterated on over the years to what similarities and differences Dojo has with various other frameworks. Discussion outside of Q&A focused mostly on the ways Dojo has changed over the years.
The Electron team is excited to announce the release of Electron 11.0.0! You can install Electron v11 with npm via `npm install electron@latest` or download it from our releases website. The release is packed with upgrades, fixes, and features.
Some highlights from the Electron 11.0.0 release include:
Improved the performance of sending wide objects over the context bridge.
Added V8 crash message and location information to crashReport parameters.
To read more about Electron 11.0.0, please read the blog here written by the Electron team.
Electron Release Schedule
Although we are careful not to make promises about release dates, our plan is to release new major versions of Electron with new versions of those components approximately quarterly. The tentative 12.0.0 schedule maps out key dates in the Electron 12.0 development life cycle. See our versioning document for more detailed information about versioning in Electron.
The OpenJS Collaboration Network can further the value of the foundation in a few key ways, while also giving value back to the community.
Support includes but not be limited to:
a GitHub repo in the OpenJS org
representation on the CPC
The current Collaboration Networks spaces are listed in the main README.md in the CPC repository.
The OpenJS Node.js Application Developer (JSNAD) and the OpenJS Node.js Services Developer (JSNSD) Exams (Node.js Certifications) will be updated from Node.js version 10, which is now in maintenance, to Node.js version 14, which is the most current LTS (Long Term Support) line. Changes will come into effect November 3, 2020. All tests taking place after 8:00 pm PT on June 16, 2020 will be based on Node.js version 14.
The updated exam will include the ability to use either native EcmaScript modules or CommonJS modules to answer questions, with CommonJS remaining the default and EcmaScript modules as an opt-in.
For example a given task on the examination may provide a folder containing an answer.js file and a package.json file. The package.json file does not contain a type field, as is the case when generating a package.json file with npm init. By default, the answer.js file is therefore considered a CommonJS module. So loading a module would be achieved like so:
const fs = require('fs')
To opt-in to native EcmaScript modules, candidates may either set the type field of the package.json file to module or may rename the answer.js file to answer.mjs. In either of those cases a module would be loaded like so:
import fs from 'fs'
Candidates may also explicitly opt-in to CommonJS by setting the type field to commonjs or by renaming the answer.js to answer.cjs but this is unnecessary as the absence of a type field means the answer.js file is interpreted as CommonJS anyway.
While there are no changes to the current set of Domains and Competencies for the JSNSAD and JSNAD Exams, candidates are advised to review functionality of libraries or frameworks on Node.js version 14. For a full list of differences between Node.js version 10 and Node.js version 14 see https://nodejs.medium.com/node-js-version-14-available-now-8170d384567e.
These exams are evergreen and soon after a Node.js version becomes the only LTS line the certifications are updated to stay in lockstep with that LTS version. Now that Node.js version 10 has moved into maintenance, certifications will be based on Node.js version 14.
The OpenJS Node.js Certification program was developed in partnership with NearForm and NodeSource. The certifications are a good way to showcase your abilities in the job market and allow companies to find top talent.
AMP Project joined the OpenJS Foundation this past summer as a Growth project, aiming to create a more “user-first” open web experience for all. In this AMA, users were able to ask questions via Twitter (#AskAMP) and live YouTube chat. This AMA followed AMP Fest, which can be viewed here. AMP Fest focuses on content where participants could “learn about the latest ways the community is working to make the web better for everyone – publishers, platforms, advertisers, creators, and of course, users.”
Questions ranged from what project individuals were most excited about to whether there should be ramifications or praise for net neutrality or the lack thereof. The talk took a mix of inquiries from chat and preset questions.
The new release includes:
N-API Version 7
Throw on unhandled rejections
Additional project news includes
Completion of the Node.js Contributors Survey to gather feedback on the contribution process to determine target areas for improvement.
big improvements to Node.js automation and tooling including the ability to kick off CI runs and land commits just by adding a GitHub label, making it easier for collaborators to manage the constant flow of Pull Requests.
The beginning of Next 10 Years of Node.js effort. The goal of this effort is to reflect on what led to success in the first 10 years of Node.js and set the direction for success in the next 10. One of the outcomes so far is that we’ve created a Technical Values document to guide our efforts.
To read more about Node.js v15, please read the blog here written by Bethany Griggs and the Node.js TSC.
Course provides requisite knowledge to develop services on Node.js, and helps prepare for OpenJS Node.js Services Developer Certification
Today, with the Linux Foundation, OpenJS Foundation is excited to offer yet another new training course, LFW212 – Node.js Services Development, as part of our growing Node.js Training and Certification Program.
Who should take this training?
LFW212 will help those developers on their way to a senior level get to the next step by demonstrating their Node.js knowledge and skills, in particular how to use Node with frameworks to rapidly and securely compose servers and services.
Specifically, this course covers Node core HTTP clients and servers, web servers, RESTful services and web security essentials.
What will I learn?
By taking this course, you will learn how to build RESTful JSON services that are secure and straightforward to maintain and will prepare you for some of the most common Node.js roles in the industry today. The course also prepares you to take the OpenJS Node.js Services Developer (JSNSD) certification. A bundled offering including access to both the training course and certification exam is also available.
To best prepare for this course, students should be familiar with the concepts covered in the OpenJS Node.js Application Developer (JSNAD) certification. To brush up on your Node.js application development skills, we recommend you complete the LFW211 – Node.js Application Development course before attempting LFW212.
About the Author
Are you ready to sign up?
The course is available to begin immediately! The $299 course fee – or $499 for a bundled offering of both the course and related certification exam – provides unlimited access to the course for one year to all content and labs. All Node.js courses and exams offered by The Linux Foundation, including these new offerings, are discounted up to 75% through October 31, including a super bundle consisting of LFW211, LFW212, JSNAD and JSNSD available for $250 during the promotional period. Interested individuals may enroll in LFW212 here or learn more about the discount on all Node.js offerings here.
Give your feedback on how you are using the Electron
This survey is intended for anyone who builds applications with this technology and will help the team learn more about how folks are using it and what challenges they are facing. The results will help maintainers address these challenges and guide the project’s roadmap.
“As an open source project, many of the decisions regarding Electron happen within GitHub repositories, however, work done within GitHub repos are only a fraction of our overall user base,” said Antón Molleda. “We are excited to have this survey reach the broad set of Electron users so we can capture requirements, challenges and use this information to create a better Electron for all.”
The survey will close Oct 28th and you can access it here.