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

@loudplay/lp-checker

v1.2.0

Published

A library to fetch OS and device characteristics and capabilities.

Readme

lp-checker-js

This is a port of lp-checker library. The repository contains precompiled static and dynamic libraries of lp-checker that are then linked with the node-addon-api glue code that exports the API.

Install

$ npm install git+ssh://github.com/loudplay/lp-checker-js.git

It will build the library automatically, though you need to have visual studio or Xcode installed for this to work.

Use with electron

lp-checker-js uses N-API, an ABI that is compatible with any future version of node.js and that's independent of the node ABI. Supposedly, you don't need to recompile this binding for electron, only once for N-API. Package uses node-pre-gyp that downloads all headers and links to correct N-API version automatically.

If you see encounter strange behavior while using this binding, be sure to look at the relevant section in Troubleshooting.

Building process

Windows

Building on Windows requires at least Visual Studio Build Tools to be installed. Download 2019 edition here.

After this npm install should generate a VS project and build the binding just fine. The only dependency is libchecker_static.lib which is supplied by this repository.

Mac

Mac is much more trickier, because lp-checker leverages the native APIs available on Mac through Swift programming language to provide system-level information. Because lp-checker is written in C++, an additional dynamic library for the swift portion of lp-checker is generated. The resulting addon should then link not only against the static library, but a dynamic library as well.

There are 2 problems:

  1. How will addon find the dynamic library it was linked against, and
  2. How will the dynamic library link against its dynamic libraries?

The answer to the first question: through rpaths. Rpath stands for RuntimePATH and is used on linux and mac by the dynamic linker to search for .so and .dylib files respectively. Additionally, mac supports several rpaths to be defined within a library (or an executable). Aside from absolute paths, rpath may also contain special paths @executable_path and @loader_path. These two paths provide an ability for a library to be moved freely within the file system as long as the dependencies are moved too.

We are interested in @loader_path. During linking it will be substituted by a path to the binary that requests linking. So, if our addon requests dynamic linker to link against libchecker_swift.dylib, @loader_path will be resolved to the path where addon is located. This leads to the following approach: we can ensure that the addon is portable across file system locations and physical computers, if only we set all paths to external dynamic libraries to be relative to @loader_path. If addon will search for libchecker_swift.dylib in @loader_path, and if libchecker_swift.dylib will search for its dependencies in @loader_path, and these dependencies will also search in @loader_path and so on and so on, then we only need to ensure to pack .addon file and all neighbouring .dylib binaries together inside an application package for it to just work.

This bundling of dylibs is performed by tools/bundle_dylib_deps.sh script. This script is ran during compilation by gyp build system. It automates process of looking dependencies of a dylib, copying them to a folder, finding their dependencies, copying them also and fixing the paths inside the dependent libraries. The script requires Xcode to be installed.

Troubleshooting

Visual Studio edition not specified

If you get this error:

npm ERR! code 1
npm ERR! git dep preparation failed
npm ERR! > @loudplay/[email protected] install
npm ERR! > node-gyp configure && node-gyp build
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | ia32
npm ERR! gyp info find Python using Python version 3.9.6 found at "C:\Users\Isabelle\scoop\apps\python\current\python.exe"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS msvs_version was set from command line or npm config
npm ERR! gyp ERR! find VS - looking for Visual Studio version 2017
npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp ERR! find VS checking VS2019 (16.10.31424.327) found at:
npm ERR! gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
npm ERR! gyp ERR! find VS - found VC++ toolset: v142
npm ERR! gyp ERR! find VS - found Windows SDK: 10.0.19041.0
npm ERR! gyp ERR! find VS - msvs_version does not match this version
npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
npm ERR! gyp ERR! find VS looking for Visual Studio 2015
npm ERR! gyp ERR! find VS - not found
npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! gyp ERR! find VS - "2019"
npm ERR! gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
...

Make sure to specify the edition of visual studio you have installed: 2015, 2017, or 2019.

$ npm config set msvs_version=2019

and install again.

Freezes, spurious crashes on Electron

NOTE: This solution is a speculation. As of writing this document, lp-checker-js is untested against Electron ABI. See if this helps.

Since electron uses different ABI than node.js, you may need to recompile it with electron ABI. Install electron-builder and execute it after every update to dependencies.

$ npm install electron-build
$ node_modules/.bin/electron-build

Or, if '.bin/electron-build' doesn't work, try electron-build.cmd executable.