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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@osmcha/osm-adiff-parser

v3.1.0

Published

Parse OSM augmented diffs to create JSON representation of changesets

Readme

osm-adiff-parser

Parses OSM augmented diff XML and returns a plain JS object representing the diff.

Installation

npm install @osmcha/osm-adiff-parser

Usage

import parser from 'osm-adiff-parser';
let adiff = await parser(augmentedDiffXmlString);

Example input & output

Input (an augmented diff of a simple changeset which added a couple of tags to an existing node)

<osm version="0.6" generator="Overpass API not used, but achavi detects it at the start of string; OSMExpress/python/examples/augmented_diff.py">
  <note>The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.</note>
  <action type="modify">
    <old>
      <node id="2523603738" version="2" user="TheRomanP" uid="3844185" timestamp="2024-06-05T13:51:12Z" changeset="152289357" lon="-121.2881568" lat="47.6647943">
        <tag k="highway" v="trailhead" />
      </node>
    </old>
    <new>
      <node id="2523603738" version="3" timestamp="2024-08-20T21:36:16Z" uid="8794039" user="jake-low" changeset="155530622" lat="47.6647943" lon="-121.2881568">
        <tag k="highway" v="trailhead" />
        <tag k="name" v="Necklace Valley Trailhead" />
        <tag k="operator" v="US Forest Service" />
        <tag k="website" v="https://www.fs.usda.gov/recarea/mbs/recarea/?recid=80228" />
      </node>
    </new>
  </action>
</osm>

Output

{
  "actions": [
    {
      "type": "modify",
      "old": {
        "type": "node",
        "id": 2523603738,
        "version": 2,
        "user": "TheRomanP",
        "uid": 3844185,
        "timestamp": "2024-06-05T13:51:12Z",
        "changeset": 152289357,
        "lon": -121.2881568,
        "lat": 47.6647943,
        "tags": {
          "highway": "trailhead"
        }
      },
      "new": {
        "type": "node",
        "id": 2523603738,
        "version": 3,
        "timestamp": "2024-08-20T21:36:16Z",
        "uid": 8794039,
        "user": "jake-low",
        "changeset": 155530622,
        "lat": 47.6647943,
        "lon": -121.2881568,
        "tags": {
          "highway": "trailhead",
          "name": "Necklace Valley Trailhead",
          "operator": "US Forest Service",
          "website": "https://www.fs.usda.gov/recarea/mbs/recarea/?recid=80228"
        }
      }
    }
  ],
  "note": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL."
}

Command line interface

This package also provides a CLI tool which reads augmented diff XML from stdin and writes the parsed representation to stdout as JSON.

$ osm-adiff-parser --help
osm-adiff-parser v3.1.0
Convert OSM augmented diff XML to a JSON representation

Usage:
  osm-adiff-parser [options] < input.xml > output.json

Options:
  -h, --help     Show this help message
  -v, --version  Show version number

History

This package is a fork of mapbox/osm-adiff-parser which is no longer maintained. Version 2.0.0 of @osmcha/osm-adiff-parser contains breaking API changes compared to version 1.1.0 of osm-adiff-parser. See the CHANGELOG for more details.