-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(base): create hello world with C++ bindings
- Loading branch information
Robin Joseph
committed
May 11, 2016
1 parent
33a6211
commit 2f4fcf5
Showing
12 changed files
with
155 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "lob", | ||
"globals": { | ||
"expect": false | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
language: node_js | ||
sudo: false | ||
addons: | ||
apt: | ||
sources: ['ubuntu-toolchain-r-test'] | ||
packages: | ||
- libpoppler-cpp-dev | ||
- libpoppler-dev | ||
- libfontconfig1-dev | ||
- libpng12-dev | ||
- libjpeg-turbo8-dev | ||
- libtiff4-dev | ||
- g++-4.9 | ||
env: CXX=g++-4.9 | ||
node_js: | ||
- '0.10' | ||
- '0.12' | ||
- '4' | ||
- '5' | ||
- '6' | ||
before_install: | ||
- npm i npm -g | ||
script: | ||
- npm test | ||
- npm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,33 @@ | ||
# pdffonts | ||
Node bindings for Poppler's pdffonts CLI | ||
|
||
Node bindings for Poppler's `pdffonts` CLI. | ||
|
||
## Dependencies | ||
|
||
For this module to install and build correctly, you'll need to make sure that [`poppler`](https://poppler.freedesktop.org/) is installed on your machine. | ||
|
||
To install Poppler on Mac OS X using Homebrew: | ||
|
||
``` | ||
brew install poppler | ||
``` | ||
|
||
To install Poppler on Ubuntu: | ||
|
||
``` | ||
apt-get install pkg-config | ||
apt-get install libpoppler-cpp-dev | ||
``` | ||
|
||
## Testing | ||
|
||
```bash | ||
$ npm i | ||
$ npm test | ||
``` | ||
|
||
## Linting | ||
|
||
```bash | ||
$ npm run lint | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"targets": [ | ||
{ | ||
"target_name": "pdffonts", | ||
"sources": [ | ||
"src/pdffonts.cc" | ||
], | ||
"include_dirs": [ | ||
"<!(node -e \"require('nan')\")" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
module.exports = require('bindings')('pdffonts'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "pdffonts", | ||
"version": "0.0.1", | ||
"description": "Node bindings for Poppler's pdffonts CLI", | ||
"main": "./lib/pdffonts.js", | ||
"scripts": { | ||
"lint": "eslint .", | ||
"release:major": "changelog -M && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version major && git push origin && git push origin --tags", | ||
"release:minor": "changelog -m && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version minor && git push origin && git push origin --tags", | ||
"release:patch": "changelog -p && git add CHANGELOG.md && git commit -m 'updated CHANGELOG.md' && npm version patch && git push origin && git push origin --tags", | ||
"test": "node-gyp rebuild && mocha test --require test/setup.js --recursive --timeout 30000" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/lob/pdffonts.git" | ||
}, | ||
"keywords": [ | ||
"poppler", | ||
"pdffonts", | ||
"pdf", | ||
"fonts" | ||
], | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/lob/pdffonts/issues" | ||
}, | ||
"homepage": "https://github.com/lob/pdffonts#readme", | ||
"dependencies": { | ||
"bindings": "^1.2.1", | ||
"nan": "^2.3.3" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"eslint": "^1.10.3", | ||
"eslint-config-lob": "^1.0.1", | ||
"generate-changelog": "^1.0.1", | ||
"mocha": "^2.4.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include <nan.h> | ||
|
||
using namespace v8; | ||
|
||
NAN_METHOD(Hello) { | ||
info.GetReturnValue().Set(Nan::New("world").ToLocalChecked()); | ||
} | ||
|
||
NAN_MODULE_INIT(Init) { | ||
Nan::Set(target, Nan::New("hello").ToLocalChecked(), Nan::GetFunction(Nan::New<FunctionTemplate>(Hello)).ToLocalChecked()); | ||
} | ||
|
||
NODE_MODULE(pdffonts, Init) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
'use strict'; | ||
|
||
var Pdffonts = require('../lib/pdffonts'); | ||
|
||
describe('pdffonts', function () { | ||
|
||
describe('hello', function () { | ||
|
||
it('returns "world"', function () { | ||
expect(Pdffonts.hello()).to.eql('world'); | ||
}); | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
var Chai = require('chai'); | ||
|
||
global.expect = Chai.expect; |