
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@modusjs/bundle
Advanced tools
All modusjs convert and examples modules in one bundle for https://cdn.skypack.dev/@modusjs/bundle
Universal library for reading/writing/validating Modus files/resources. Converts between:
This library works in the browser and in node.
yarn add @modusjs/convert
# or
npm install @modusjs/convert
import { xml } from '@modusjs/convert'
// Just parse as tolerantly as possible, no validation against resulting json schema:
const json_unvalidated = xml.parse(xml_string_from_somewhere);
// parse and validate
const json = xml.parseAsModusResult(xml_string_from_somewhere);
import { csv } from '@modusjs/convert'
// Using the tomkat generic xlsx parsing
// (works for sheets that have the structure outlined below)
// parse as base64:
let json = parse({ base64: base_64_string, format: 'tomkat' });
// parse as ArrayBuffer (useful when retrieving from Google Drive, for example):
json = parse({ arrbuf: the_array_buffer, format: 'tomkat' });
// parse as string (i.e. a CSV):
json = parse({ str: csv_string, format: 'tomkat' });
// parse from an already-parsed SheetJS workbook (https://www.npmjs.com/package/xlsx)
json = parse({ wb: parsed_workbook, format: 'tomkat' });
Because lab result formats are highly irregular, the CSV conversion may require some hand modifications currently to what is directly produced by a lab:
COMMENT to any column of a row that you want to ignore from parsing. Do this to pretty much any non lab-result rows.UNITS to any column of a row that contains unit information for the corresponding column header. This will override any unit information used by default for lab result elements.With these simple modifications, most CSV files can be coerced into modus format without too much effort.
This library is universal, so it runs tests both in-browser and in node. To simplify
browser testing, the src/test/ folder holds an HTML file that opens a browser on your machine,
imports the compiled test bundle, and then runs the tests listed there. Option for getting
an automated result from this in the future might be TestCafe...
To run just the browser tests: yarn test:browser.
To run just the node tests: yarn test:node.
To build: yarn build.
To rollup dist/index.mjs bundle for browser: yarn build:rollup
To compile/bundle everything live as you code: yarn dev
To run all tests live as you code (you should run yarn dev at the same time): yarn test.
FAQs
All modusjs convert and examples modules in one bundle for https://cdn.skypack.dev/@modusjs/bundle
We found that @modusjs/bundle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.