Skip to content

Commit

Permalink
Updated dependencies and added needed libs for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
viict committed Apr 10, 2022
1 parent af185a8 commit d867869
Show file tree
Hide file tree
Showing 29 changed files with 1,952 additions and 1,708 deletions.
21 changes: 1 addition & 20 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,11 @@ pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
build/

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm

# Optional REPL history
.node_repl_history
57 changes: 43 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,60 @@
# NBioBSP Module for Nodejs
# NITGEN ENBSP Module for Nodejs

Digital fingerprint reader module for Python using Nitgen device.
Install the driver that is the "driver" directory.
Digital fingerprint reader module for NodeJS using a Nitgen device.

PS: I used the versions 0.12.5 and 0.10.25.
Currently tested on Windows with NodeJS 16 (x86), Python 3.10 (x86) and VS 2019 (x64/x86)

Based on the awesome work from [Paulo Roberto](https://github.com/xxpauloxx/nodejs-nbiobsp)

## Usage: as dependency

```bash
git clone https://github.com/paulopinda/nodejs-nbiobsp.git
cd nodejs-nbiobsp
./setup.sh
node test.js
yarn add @viict/node-nitgen-enbsp

```
#### Simple code

```javascript
const enbsp = require('@viict/node-nitgen-enbsp');
const init = enbsp.init();

if(init == true){
console.log("Insert the first fingerprint: ");
const fir1 = enbsp.capture(4000);

console.log("Insert the second fingerprint: ");
const fir2 = enbsp.capture(4000);
}

console.log(`Match: `, enbsp.match(fir1, fir2));
enbsp.close()
```

## Usage: cloning repo

```bash
git clone https://github.com/viict/node-nitgen-enbsp.git
cd node-nitgen-enbsp
yarn
yarn test
```

#### Simple code

```javascript
var nbiobsp = require('./build/Release/nbiobsp');
var init = nbiobsp.init();
const enbsp = require('./index.js');
const init = enbsp.init();

if(init == true){
console.log("Insert the first fingerprint: ");
var fir1 = nbiobsp.capture(4000);
const fir1 = enbsp.capture(4000);

console.log("Insert the second fingerprint: ");
var fir2 = nbiobsp.capture(4000);
const fir2 = enbsp.capture(4000);
}

console.log(nbiobsp.match(fir1, fir2));
nbiobsp.close()
console.log(`Match: `, enbsp.match(fir1, fir2));
enbsp.close()
```

#### Any problem? Open a new issue
11 changes: 8 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@
"targets": [
{
"target_name": "nbiobsp",
"sources": [ "nbiobsp.cpp" ],
"libraries": [
"-lNBioBSP", "-L/lib"
"sources": [ "src/nbiobsp.cpp" ],
'include_dirs': [
'./src/include',
],
'libraries': [
"<(module_root_dir)/src/lib/NBioBSP.lib",
"<(module_root_dir)/src/lib/NBioAPI_CheckValidity.lib",
"<(module_root_dir)/src/lib/NImgConv.lib",
],
"cflags": ["-Wall", "-std=c++11", "-lNBioBSP"],
}
Expand Down
12 changes: 12 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const path = require('path');

exports = module.exports = require('node-gyp-build')(__dirname);

const setSkin = exports.setSkin;
// Override setSkin to use the DLLs we are providing on node_modules path
exports.setSkin = function(skin) {
if (skin.indexOf('/') === - 1 && skin.indexOf('\\') === -1) {
return setSkin(path.join(__dirname, 'skins', skin));
}
return setSkin(skin);
}
154 changes: 0 additions & 154 deletions nbiobsp.cpp

This file was deleted.

10 changes: 0 additions & 10 deletions nbiobsp.h

This file was deleted.

29 changes: 19 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
{
"name": "nbiobsp",
"version": "1.0.0",
"description": "NBioBSP module for Nodejs.",
"main": "test.js",
"private": true,
"name": "@viict/node-nitgen-enbsp",
"version": "0.0.1",
"description": "NITGEN eNBSP Node Module",
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/viict/node-nitgen-enbsp.git"
},
"keywords": ["nitgen", "node", "enbsp", "biometry", "fingerprint"],
"author": "Victor Moura <[email protected]>",
"license": "GPL",
"bugs": {
"url": "https://github.com/viict/node-nitgen-enbsp/issues"
},
"homepage": "https://github.com/viict/node-nitgen-enbsp",
"scripts": {
"test": "node test.js"
"test": "node test.js",
"install": "node-gyp-build"
},
"gypfile": true,
"dependencies": {
"bindings": "~1.2.1"
"node-gyp-build": "^4.4.0"
}
}

}
10 changes: 0 additions & 10 deletions setup.sh

This file was deleted.

Binary file added skins/NBSP2Eng.dll
Binary file not shown.
Binary file added skins/NBSP2Jpn.dll
Binary file not shown.
Binary file added skins/NBSP2Kor.dll
Binary file not shown.
Binary file added skins/NBSP2Por.dll
Binary file not shown.
Loading

0 comments on commit d867869

Please sign in to comment.