node package manager


Node.js bindings to Osmium


Flexible Javascript library for working with OpenStreetMap data.

Provides bindings to the libosmium C++ library.

NPM Build Status Coverage Status Dependencies

Should you use node-osmium?

If you want top performance use libosmium directly in C++. These node-osmium bindings, due to the expense of passing objects from C++ to Javascript, are much slower than working in C++ directly. Consider node-osmium only for small extracts and prototyping. For large extracts or planet processing we recommend leveraging the libosmium C++ API instead of using node-osmium.

Is node-osmium actively developed?

@springmeyer and @joto are maintaining node-osmium but not actively adding features. We will consider pull requests adding features only when they come with very solid tests, add very clear value to the bindings, and seem easy to maintain.


  • Node.js v0.10.x, v4.x, v5.x, v6.x (v4 and later supported only with node-osmium >= 0.5.x)
  • Mocha (, for tests)
  • Compiler that supports -std=c++11 (>= clang++ 3.6 || >= g++ 4.8)
  • libosmium >= 2.10.3 (Debian/Ubuntu: libosmium2-dev)
  • protozero >= 1.4.5 This is included in the libosmium repository and might or might not have been installed with it. See the libosmium README. (Debian/Ubuntu: protozero)
  • Utfcpp This is included in the libosmium repository and might or might not have been installed with it. See the libosmium README. (Debian/Ubuntu: libutfcpp-dev)
  • Boost >= 1.55 with development headers (Debian/Ubuntu: libboost-dev)
  • zlib (Debian/Ubuntu: zlib1g-dev)
  • expat Debian/Ubuntu: libexpat1-dev

See also the dependency information for the Osmium library.

Set dependencies up on Ubuntu Precise (12.04) like:

sudo apt-add-repository --yes ppa:chris-lea/node.js
sudo apt-add-repository --yes ppa:ubuntu-toolchain-r/test
sudo apt-get -y update
sudo apt-get -y install git gcc-4.8 g++-4.8 build-essential nodejs
sudo apt-get -y install libboost-dev zlib1g-dev libexpat1-dev libsparsehash-dev
export CC=gcc-4.8
export CXX=g++-4.8
git clone
cd OSM-binary/src
make && sudo make install

Set dependencies up on OS X like:

git clone
cd mapnik-packaging/osx
export CXX11=true
./scripts/ --with-test --with-program_options
# NOTE: in the same terminal then run the build commands 
# Or from a different terminal re-run `source` 


By default, binaries are provided and no external dependencies or compile is needed.

Just do:

npm install osmium

We currently provide binaries for 64 bit OS X and 64 bit Linux. Running npm install on other platforms will fall back to a source compile (see Developing below for build details).


See the tutorial for an introduction. There are some demo applications in the 'demo' directory. See the there. You can also have a look at the tests in the test directory.


If you wish to develop on node-osmium you can check out the code and then build like:

git clone
cd node-osmium

Use make debug to build with debug information. Use make coverage to build with code coverage.

Use make VERBOSE=1 to output compiler calls used etc.


npm install mocha
make test


node-osmium is available under the Boost Software License. See LICENSE.txt for details.


Please open bug reports on You can ask questions on the OSM developer mailing list or on OFTC net IRC channel #osm-dev.