<spanclass=w></span><spanclass=nt>"name"</span><spanclass=p>:</span><spanclass=w></span><spanclass=s2>"JSON for Modern C++"</span><spanclass=p>,</span>
</code></pre></div><h2id=homebrew>Homebrew<aclass=headerlinkhref=#homebrewtitle="Permanent link">¶</a></h2><p>If you are using OS X and <ahref=http://brew.sh>Homebrew</a>, just type</p><divclass=highlight><pre><span></span><code>brew<spanclass=w></span>install<spanclass=w></span>nlohmann-json
</code></pre></div><p>and you're set. If you want the bleeding edge rather than the latest release, use</p><divclass=highlight><pre><span></span><code>brew<spanclass=w></span>install<spanclass=w></span>nlohmann-json<spanclass=w></span>--HEAD
</code></pre></div><p>instead. See <ahref=https://formulae.brew.sh/formula/nlohmann-json>nlohmann-json</a> for more information.</p><detailsclass=example><summary>Example</summary><ol><li><p>Create the following file:</p><divclass=highlight><spanclass=filename>example.cpp</span><pre><span></span><code><spanclass=cp>#include</span><spanclass=w></span><spanclass=cpf><nlohmann/json.hpp></span>
</code></pre></div></li><li><p>Install the package</p><divclass=highlight><pre><span></span><code>brew<spanclass=w></span>install<spanclass=w></span>nlohmann-json
</code></pre></div></li><li><p>Determine the include path, which defaults to <code>/usr/local/Cellar/nlohmann-json/$version/include</code>, where <code>$version</code> is the version of the library, e.g. <code>3.7.3</code>. The path of the library can be determined with</p><divclass=highlight><pre><span></span><code>brew<spanclass=w></span>list<spanclass=w></span>nlohmann-json
</code></pre></div></li><li><p>Compile the code. For instance, the code can be compiled using Clang with</p><divclass=highlight><pre><span></span><code>clang++<spanclass=w></span>example.cpp<spanclass=w></span>-I/usr/local/Cellar/nlohmann-json/3.7.3/include<spanclass=w></span>-std<spanclass=o>=</span>c++11<spanclass=w></span>-o<spanclass=w></span>example
</code></pre></div></li></ol></details><p><spanclass=twemoji><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1a6.887 6.887 0 0 0 0 9.8c2.73 2.7 7.15 2.7 9.88 0 1.36-1.35 2.04-2.92 2.04-4.9h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58a8.987 8.987 0 0 1 12.65 0L21 3v7.12M12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5Z"/></svg></span> The <ahref=https://formulae.brew.sh/formula/nlohmann-json>formula</a> is updated automatically.</p><h2id=meson>Meson<aclass=headerlinkhref=#mesontitle="Permanent link">¶</a></h2><p>If you are using the <ahref=http://mesonbuild.com>Meson Build System</a>, add this source tree as a <ahref=https://mesonbuild.com/Subprojects.html#using-a-subproject>meson subproject</a>. You may also use the <code>include.zip</code> published in this project's <ahref=https://github.com/nlohmann/json/releases>Releases</a> to reduce the size of the vendored source tree. Alternatively, you can get a wrap file by downloading it from <ahref=https://wrapdb.mesonbuild.com/nlohmann_json>Meson WrapDB</a>, or simply use <code>meson wrap install nlohmann_json</code>. Please see the meson project for any issues regarding the packaging.</p><p>The provided <code>meson.build</code> can also be used as an alternative to cmake for installing <code>nlohmann_json</code> system-wide in which case a pkg-config file is installed. To use it, simply have your build system require the <code>nlohmann_json</code> pkg-config dependency. In Meson, it is preferred to use the <ahref=https://mesonbuild.com/Reference-manual.html#dependency><code>dependency()</code></a> object with a subproject fallback, rather than using the subproject directly.</p><h2id=bazel>Bazel<aclass=headerlinkhref=#bazeltitle="Permanent link">¶</a></h2><p>This repository provides a <ahref=https://bazel.build/>Bazel</a><code>WORKSPACE.bazel</code> and a corresponding <code>BUILD.bazel</code> file. Therefore, this repository can be referenced by workspace rules such as <code>http_archive</code>, <code>git_repository</code>, or <code>local_repository</code> from other Bazel workspaces. To use the library you only need to depend on the target <code>@nlohmann_json//:json</code> (e.g. via <code>deps</code> attribute).</p><h2id=conan>Conan<aclass=headerlinkhref=#conantitle="Permanent link">¶</a></h2><p>If you are using <ahref=https://www.conan.io/>Conan</a> to manage your dependencies, merely add <code>nlohmann_json/x.y.z</code> to your <code>conanfile</code>'s requires, where <code>x.y.z</code> is the release version you want to use. Please file issues <ahref=https://github.com/conan-io/conan-center-index/issues>here</a> if you experience problems with the packages.</p><detailsclass=example><summary>Example</summary><ol><li><p>Create the following files:</p><divclass=highlight><spanclass=filename>Conanfile.txt</span><pre><span></span><code><spanclass=k>[requires]</span>
</code></pre></div></li></ol></details><p><spanclass=twemoji><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1a6.887 6.887 0 0 0 0 9.8c2.73 2.7 7.15 2.7 9.88 0 1.36-1.35 2.04-2.92 2.04-4.9h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58a8.987 8.987 0 0 1 12.65 0L21 3v7.12M12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5Z"/></svg></span> The <ahref=https://conan.io/center/nlohmann_json>package</a> is updated automatically.</p><h2id=spack>Spack<aclass=headerlinkhref=#spacktitle="Permanent link">¶</a></h2><p>If you are using <ahref=https://www.spack.io/>Spack</a> to manage your dependencies, you can use the <ahref=https://spack.readthedocs.io/en/latest/package_list.html#nlohmann-json><code>nlohmann-json</code> package</a>. Please see the <ahref=https://github.com/spack/spack>spack project</a> for any issues regarding the packaging.</p><h2id=hunter>Hunter<aclass=headerlinkhref=#huntertitle="Permanent link">¶</a></h2><p>If you are using <ahref=https://github.com/cpp-pm/hunter>hunter</a> on your project for external dependencies, then you can use the <ahref=https://hunter.readthedocs.io/en/latest/packages/pkg/nlohmann_json.html>nlohmann_json package</a>. Please see the hunter project for any issues regarding the packaging.</p><h2id=buckaroo>Buckaroo<aclass=headerlinkhref=#buckarootitle="Permanent link">¶</a></h2><p>If you are using <ahref=https://buckaroo.pm>Buckaroo</a>, you can install this library's module with <code>buckaroo add github.com/buckaroo-pm/nlohmann-json</code>. Please file issues <ahref=https://github.com/buckaroo-pm/nlohmann-json>here</a>. There is a demo repo <ahref=https://github.com/njlr/buckaroo-nholmann-json-example>here</a>.</p><h2id=vcpkg>vcpkg<aclass=headerlinkhref=#vcpkgtitle="Permanent link">¶</a></h2><p>If you are using <ahref=https://github.com/Microsoft/vcpkg/>vcpkg</a> on your project for external dependencies, then you can install the <ahref=https://github.com/Microsoft/vcpkg/tree/master/ports/nlohmann-json>nlohmann-json package</a> with <code>vcpkg install nlohmann-json</code> and follow the then displayed descriptions. Please see the vcpkg project for any issues regarding the packaging.</p><detailsclass=example><summary>Example</summary><ol><li><p>Create the following files:</p><divclass=highlight><spanclass=filename>CMakeLists.txt</span><pre><span></span><code><spanclass=nb>project</span><spanclass=p>(</span><spanclass=s>json_example</span><spanclass=p>)</span>
</code></pre></div></li></ol><p>Note you need to adjust <code>/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake</code> to your system.</p></details><h2id=cget>cget<aclass=headerlinkhref=#cgettitle="Permanent link">¶</a></h2><p>If you are using <ahref=http://cget.readthedocs.io/en/latest/>cget</a>, you can install the latest development version with <code>cget install nlohmann/json</code>. A specific version can be installed with <code>cget install nlohmann/json@v3.1.0</code>. Also, the multiple header version can be installed by adding the <code>-DJSON_MultipleHeaders=ON</code> flag (i.e., <code>cget install nlohmann/json -DJSON_MultipleHeaders=ON</code>).</p><p><spanclass=twemoji><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1a6.887 6.887 0 0 0 0 9.8c2.73 2.7 7.15 2.7 9.88 0 1.36-1.35 2.04-2.92 2.04-4.9h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58a8.987 8.987 0 0 1 12.65 0L21 3v7.12M12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5Z"/></svg></span> cget reads directly from the <ahref=https://github.com/nlohmann/json>GitHub repository</a> and is always up-to-date.</p><h2id=cocoapods>CocoaPods<aclass=headerlinkhref=#cocoapodstitle="Permanent link">¶</a></h2><p>If you are using <ahref=https://cocoapods.org>CocoaPods</a>, you can use the library by adding pod <code>"nlohmann_json", '~>3.1.2'</code> to your podfile (see <ahref=https://bitbucket.org/benman/nlohmann_json-cocoapod/src/master/>an example</a>). Please file issues <ahref="https://bitbucket.org/benman/nlohmann_json-cocoapod/issues?status=new&status=open">here</a>.</p><h2id=nuget>NuGet<aclass=headerlinkhref=#nugettitle="Permanent link">¶</a></h2><p>If you are using <ahref=https://www.nuget.org>NuGet</a>, you can use the package <ahref=https://www.nuget.org/packages/nlohmann.json/>nlohmann.json</a>. Please check <ahref=https://github.com/nlohmann/json/issues/1132#issuecomment-452250255>this extensive description</a> on how to use the package. Please file issues <ahref=https://github.com/hnkb/nlohmann-json-nuget/issues>here</a>.</p><h2id=conda>Conda<aclass=headerlinkhref=#condatitle="Permanent link">¶</a></h2><p>If you are using <ahref=https://conda.io/>conda</a>, you can use the package <ahref=https://github.com/conda-forge/nlohmann_json-feedstock>nlohmann_json</a> from <ahref=https://conda-forge.org>conda-forge</a> executing <code>conda install -c conda-forge nlohmann_json</code>. Please file issues <ahref=https://github.com/conda-forge/nlohmann_json-feedstock/issues>here</a>.</p><h2id=msys2>MSYS2<aclass=headerlinkhref=#msys2title="Permanent link">¶</a></h2><p>If you are using <ahref=http://www.msys2.org/>MSYS2</a>, you can use the <ahref=https://packages.msys2.org/base/mingw-w64-nlohmann-json>mingw-w64-nlohmann-json</a> package, just type <code>pacman -S mingw-w64-i686-nlohmann-json</code> or <code>pacman -S mingw-w64-x86_64-nlohmann-json</code> for installation. Please file issues <ahref="https://github.com/msys2/MINGW-packages/issues/new?title=%5Bnlohmann-json%5D">here</a> if you experience problems with the packages.</p><p><spanclass=twemoji><svgxmlns=http://www.w3.org/2000/svgviewbox="0 0 24 24"><pathd="M21 10.12h-6.78l2.74-2.82c-2.73-2.7-7.15-2.8-9.88-.1a6.887 6.887 0 0 0 0 9.8c2.73 2.7 7.15 2.7 9.88 0 1.36-1.35 2.04-2.92 2.04-4.9h2c0 1.98-.88 4.55-2.64 6.29-3.51 3.48-9.21 3.48-12.72 0-3.5-3.47-3.53-9.11-.02-12.58a8.987 8.987 0 0 1 12.65 0L21 3v7.12M12.5 8v4.25l3.5 2.08-.72 1.21L11 13V8h1.5Z"/></svg></span> The <ahref=https://packages.msys2.org/base/mingw-w64-nlohmann-json>package</a> is updated automatically.</p><h2id=macports>MacPorts<aclass=headerlinkhref=#macportstitle="Permanent link">¶</a></h2><p>If you are using <ahref=https://ports.macports.org>MacPorts</a>, execute <code>sudo port install nlohmann-json</code> to install the <ahref=https://ports.macports.org/port/nlohmann-json/>nlohmann-json</a> package.</p><p><spanclass=twemoji><svgxmlns=http:/