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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kiva/fingerprint-api-simulator

v0.1.10

Published

Node CLI tool to easily set up a mock fingerprint scanning API

Downloads

5

Readme

Fingerprint Scanning Simulation API

This CLI tool is designed to get you up and running with a mock fingerprint scanner that can be accessed via a request to your localhost.

Quickstart

Install the package

npm i @kiva/fingerprint-api-simulator

Once installed, set up a script in your package.json file using the swrl command from our package.

{
    ...
    "scripts": {
        "simulator": "swrl"
    }
    ...
}

...

npm run simulator

This will automatically boot up a server on your localhost for port 9907. We have included a clipart image of a fingerprint for convenience, so you should be able to get the data you need by running (in a separate terminal window):

curl http://localhost:9907/EKYC/Fingerprint

Customizing Output

We have included lots of customization options, if you want to include data beyond the default response from the API. None are required, and you can mix and match them to your heart's content.

-p, --port

Use this option to specify which port your API runs on. Defaults to 9907.

-i, --image

Use this option to provide a path to an image file that will be included as the fingerprint image in the server response. The image will be automatically converted into a base64 string. We have provided a default for this option.

--endpoints

Use this option to create a list of endpoints that can be called in order to get the fingerprint data. All of the endpoints will return the same data. This option can be space- or comma-separated values, or you can mix and match. Defaults to ['/EKYC/Info', '/EKYC/Fingerprint'].

# Would give you # ['/MyCoolPath/', '/MyOtherCoolPath', '/HeresAnotherCoolPath', '/AndOneMoreForFun']
swrl --endpoints /MyCoolPath,/MyOtherCoolPath /HeresAnotherCoolPath /AndOneMoreForFun

-f, --file

You can use this option to provide a file containing extra data that you want to include in the API response. You can use a JS or JSON file, and we support both CommonJS and ESModule files.

Custom Options

Don't have enough extra data for you to want to create a whole extra file? No worries - you're allowed to simply add your own custom option to the command line, and the data will automatically be included.

swrl --token <a token> --password <secret... until someone calls your API>

Optional: Docker

The @kiva/fingerprint-api-simulator package can be installed and run locally, but we also have an option to run the API via Docker (which you can install here).

In order to run the API, you will need to move into this directory (ssi-wizard-sdk/fingerprint-api-simulator) and run these commands.

docker build -t fp-api .
docker run -p 9907:9907 fp-api

This will launch the API on port 9907 with all the defaults enabled.

You can add the -d flag to the docker run command in order to run the API in detached mode.

[~] docker run -d -p 9907:9907 fp-api
[~] echo "We can do other stuff now"