npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

revman

v1.4.2

Published

Simple module that reads a RevMan XML file and makes it suitable for use in Node

Downloads

4

Readme

Simple RevMan XML file reader

Simple module that reads a RevMan XML file and makes it suitable for use in Node.

The following operations are applied to the raw source data:

  • XML (buffer or string) translated into JSON object
  • All XML keys lower-cased and camelCased
  • Initial cochraneReview key removed and main body returned as object
  • Date fields automatically translated into Date objects
  • Various fields automatically translated into arrays
  • The participants field will automatically be calculated for each comparison each dichOutcome and each dichSubgroup
  • The p field is calculated and rounded using the pRounding precision. pText is also calculated (e.g. P < 0.001 etc.)
  • The effectMeasureText value is set to the long-hand version of the shorter effectMeasure value (e.g. effectMeasure=RR sets effectMeasureText=Rick Ratio)
  • The outcome collection is calculated for each comparison providing easier access to the outcomes and studies without having to look at specific types of study key
  • The outcomeType key is set for each outcome to label what type of outcome it is
var revman = require('revman');

revman.parseFile('./test/data/antibiotics-for-sore-throat.rm5', function(err, res, warnings) {
	// Data should now be a JSON tree object
});

See the antibiotics-for-sore-throat.json file for the JSON output for that sample file and as a rough guide as to the valid RevMan fields.

Outcome traversal

In order to simplify traversal of a RevMan file an additional meta object, outcome, is added to each comparison. The structure of this object is usually of the form: comparisons[].outcome[].subgroup[].study[].

However, since comparisons sometimes do not contain subgroups that portion of the path is optional.

The following trees are example structures using the outcome structure:

// The first study within an outcome that has subgroups
analysesAndData.comparison[0].outcome[0].subgroup[0].study[0]

// The first study within an outcome with no subgroups
analysesAndData.comparison[0].outcome[0].study[0]

API

parse(data, [options], callback)

Parse raw data (data is assumed to be valid XML as a string, stream or buffer) and return the formatted output.

The callback will be called with the pattern (err, parsedResult, warnings). Warnings will be an array of any non-fatal errors encounted when parsing the files (empty subGroups, missing studies etc.)

Options can be any of the following:

| Option | Type | Default | Description | |-----------------------|----------------|----------------|-------------------------------------------------------------------------------------------------------| | pRounding | Number | 6 | Decimal place precision when rounding P values | | arrayFields | Array | See code | An array of fields that should be coerced into an array | | booleanFields | Array(Strings) | See code | An array of fields that should be translated into JavaScript booleans | | dateFields | Array(Strings) | ['modified'] | An array of fields that should be translated into JavaScript dates | | numberFields | Array(Strings) | See code | An array of fields that should be translated into JavaScript numbers | | floatFields | Array(Strings) | See code | An array of fields that should be translated into JavaScript floats | | effectMeasureLookup | Object | See code | Text value of shorthand effect measures (e.g. effectMeasure=RR sets effectMeasureText=Rick Ratio) | | outcomeKeys | Array(Objects) | See code | Keys to use when creating the outcome structure. Set this to falsy to disable | | removeEmptyOutcomes | Boolean | true | Remove any invalid looking outcomes with no studies or subgroup child nodes | | debugOutcomes | Boolean | false | Be extra careful reading the comparison structure and warn on any unknown *Outcome keys |

parseFile(path, [options], callback)

Convenience function to read a file from disk and return the formatted output.

See the parse() function for details on the available options.

Sample data credits

Thanks to Anneliese Spinks, Paul Glasziou, Chris Del Mar for the sample data set antibiotics-for-sore-throat which forms the supplied testing kit.