Skip to content

Commit 0b4ecd8

Browse files
authored
Release 22.8 (#45)
* Migrate from Node 10 to Node 12 * Speed up tests * Change example from PDF417 to QR * Release 22.8
1 parent aa46c5f commit 0b4ecd8

16 files changed

Lines changed: 19138 additions & 5047 deletions

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ indent_style = space
1414
indent_size = 4
1515
max_line_length = 120
1616

17-
[CODEOWNERS]
17+
[{CODEOWNERS,Makefile}]
1818
indent_style = tab

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
strategy:
2121
matrix:
22-
node-version: [14.x, 16.x, 18.x]
22+
node-version: [ 12.x, 14.x, 16.x, 18.x ]
2323

2424
steps:
2525
- uses: actions/checkout@v2

.npmignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
**/*
2+
!dist/**/*
3+
!package.json
4+
!LICENSE
5+
!README.md

Makefile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.PHONY: all
2-
all: clean ci lint build cover
2+
all: init lint build cover
33

44
.PHONY: github-ci
5-
github-ci: ci lint test
5+
github-ci: init lint test
66

77
.PHONY: init
88
init:
9-
npm install
9+
-npm clean-install
1010

1111
.PHONY: format
1212
format:
@@ -19,16 +19,18 @@ lock:
1919

2020
.PHONY: clean
2121
clean:
22-
rm -rf built dist node_modules || true
22+
-rm -rf built dist node_modules coverage
2323

2424
.PHONY: build
2525
build:
2626
npm run prepare
2727

28-
.PHONY: test
29-
test: build
28+
.PHONY: npm-test
29+
npm-test: build
3030
npm test
31-
./scripts/run_example.sh
31+
32+
.PHONY: test
33+
test: npm-test example
3234

3335
.PHONY: cover
3436
cover:
@@ -50,14 +52,15 @@ check-git:
5052
git fetch --depth 1 origin
5153
git diff origin/main --exit-code
5254

53-
.PHONY: ci
54-
ci:
55-
npm ci || true
56-
5755
.PHONY: publish
58-
publish: clean ci test check-git
56+
publish: clean init test check-git
5957
npm publish
6058

6159
.PHONY: publish-docker
62-
publish-docker: ci test
60+
publish-docker: init test
6361
npm publish
62+
63+
.PHONY: example
64+
example:
65+
./scripts/extract_js_from_README.sh > "example.js"
66+
./scripts/run_example.sh

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![npm](https://img.shields.io/npm/v/aspose-barcode-cloud-node)](https://www.npmjs.com/package/aspose-barcode-cloud-node)
66

77
+ API version: 3.0
8-
+ Package version: 22.7.0
8+
+ Package version: 22.8.0
99

1010
## Demo applications
1111

@@ -35,24 +35,26 @@ npm install aspose-barcode-cloud-node --save
3535

3636
### Sample usage
3737

38-
The examples below show how your application have to generate PDF417 barcode and save it on local storage:
38+
The examples below show how your application have to generate QR code and save it on local storage:
3939

4040
```js
4141
const fs = require('fs');
4242
const Barcode = require('aspose-barcode-cloud-node');
4343

4444
const config = new Barcode.Configuration(
4545
'Client Id from https://dashboard.aspose.cloud/applications',
46-
'Client Secret from https://dashboard.aspose.cloud/applications'
46+
'Client Secret from https://dashboard.aspose.cloud/applications',
47+
null,
48+
process.env['TEST_CONFIGURATION_ACCESS_TOKEN']
4749
);
4850

4951
async function generateBarcode(api) {
5052
const request = new Barcode.GetBarcodeGenerateRequest(
51-
Barcode.EncodeBarcodeType.Pdf417,
53+
Barcode.EncodeBarcodeType.QR,
5254
'Aspose.BarCode for Cloud Sample');
5355
const oneBarcode = await api.getBarcodeGenerate(request);
5456

55-
const fileName = 'Pdf417.png'
57+
const fileName = 'QR.png'
5658
fs.writeFileSync(fileName, oneBarcode.body);
5759

5860
return fileName;
@@ -61,7 +63,9 @@ async function generateBarcode(api) {
6163
async function recognizeBarcode(api, fileName) {
6264
const request = new Barcode.PostBarcodeRecognizeFromUrlOrContentRequest();
6365
request.image = fs.readFileSync(fileName);
66+
request.type = Barcode.DecodeBarcodeType.QR;
6467
request.preset = Barcode.PresetType.HighPerformance;
68+
request.fastScanOnly = true;
6569

6670
const result = await api.postBarcodeRecognizeFromUrlOrContent(request);
6771

example.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const fs = require('fs');
1+
const fs = require('fs');
22
const Barcode = require('aspose-barcode-cloud-node');
33

44
const config = new Barcode.Configuration(
@@ -10,11 +10,11 @@ const config = new Barcode.Configuration(
1010

1111
async function generateBarcode(api) {
1212
const request = new Barcode.GetBarcodeGenerateRequest(
13-
Barcode.EncodeBarcodeType.Pdf417,
13+
Barcode.EncodeBarcodeType.QR,
1414
'Aspose.BarCode for Cloud Sample');
1515
const oneBarcode = await api.getBarcodeGenerate(request);
1616

17-
const fileName = 'Pdf417.png'
17+
const fileName = 'QR.png'
1818
fs.writeFileSync(fileName, oneBarcode.body);
1919

2020
return fileName;
@@ -23,7 +23,9 @@ async function generateBarcode(api) {
2323
async function recognizeBarcode(api, fileName) {
2424
const request = new Barcode.PostBarcodeRecognizeFromUrlOrContentRequest();
2525
request.image = fs.readFileSync(fileName);
26+
request.type = Barcode.DecodeBarcodeType.QR;
2627
request.preset = Barcode.PresetType.HighPerformance;
28+
request.fastScanOnly = true;
2729

2830
const result = await api.postBarcodeRecognizeFromUrlOrContent(request);
2931

0 commit comments

Comments
 (0)