osmtogeojson is a Javascript module for converting OSM data (OSM XML or Overpass JSON) to GeoJSON. It works in the browser, nodejs and can also be used as a command line tool. This OSM conversion code was written for and is maintained by the overpass-turbo project.
Usage:
<script src='osmtogeojson.js'></script>
osmtogeojson(osm_data);
$ npm install osmtogeojson
var osmtogeojson = require('osmtogeojson');
osmtogeojson(xml_data);
$ npm install -g osmtogeojson
$ osmtogeojson file.osm > file.geojson
download osmtogeojson.js
github: tyrasd/osmtogeojson
npm: osmtogeojson
license: MIT