Public Lab Research note

spectral-workbench released for Node.js

by warren | April 07, 2016 16:19 07 Apr 16:19 | #12933 | #12933

I spent a little time over the past few days to do a test, and was able to get the JavaScript portions of Spectral Workbench 2 to run independently from the parent Rails application, and was able to get it running as a pure JavaScript library, and release it as an NPM module:

You can now install spectral-workbench with:

npm install spectral-workbench

Note that not all functions can be run from Node.js, since some still depend on a browser environment and HTML. The goal here is to modularize so that:

  • code is more maintainable
  • the JavaScript modules are potentially more broadly useful on their own

I'm interested in how these functions could be further broken down into smaller, reusable parts, and also how they might be of use to other spectrometry hackers out there.

All the tests are running and maybe the next step would be to make it possible to read an image directly from a Node.js console, and extract a spectrum. I also think this is a good space to try reading in various spectral data formats -- that functionality would then be made available in There's also more modularization to do -- for example, further generalizing some of the functions, and breaking out the web-UI-related code, potentially into its own sub-library.


This is just an experimental step, but if others out there are interested in developing spectral analysis software, we may be able to build a wider coalition around these tools if they're more flexible and repurposable. I still think the vast majority of DIY spectrometry folks will use, but this may help us to refine the tools that underpin it.


Login to comment.