Socket
Socket
Sign inDemoInstall

aspose-barcode-cloud-node

Package Overview
Dependencies
0
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

aspose-barcode-cloud-node

Aspose.BarCode Cloud SDK for Node.js


Version published
Maintainers
2
Weekly downloads
26
decreased by-3.7%
Bundle size
12.7 kB
Minified + gzipped

Weekly downloads

Readme

Source

Aspose.BarCode Cloud SDK for Node.js

License Node.js CI npm

  • API version: 3.0
  • Package version: 24.3.0

Demo applications

Scan QRGenerate BarcodeRecognize Barcode
ScanQRGenerateRecognize
Generate Wi-Fi QREmbed BarcodeScan Barcode
Wi-FiQREmbedScan

Aspose.BarCode for Cloud is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements.

This repository contains Aspose.BarCode Cloud SDK for Node.js source code.

To use these SDKs, you will need Client Id and Client Secret which can be looked up at Aspose Cloud Dashboard (free registration in Aspose Cloud is required for this).

How to use the SDK

The complete source code is available in this repository folder. You can either directly use it in your project via source code or get nmpjs distribution (recommended).

Install Aspose.BarCode for Cloud via NPM

From the command line:

npm install aspose-barcode-cloud-node --save

Sample usage

The examples below show how your application have to generate QR code and save it on local storage:

const fs = require('fs');
const Barcode = require('aspose-barcode-cloud-node');

const config = new Barcode.Configuration(
    'Client Id from https://dashboard.aspose.cloud/applications',
    'Client Secret from https://dashboard.aspose.cloud/applications',
    null,
    process.env['TEST_CONFIGURATION_ACCESS_TOKEN']
);

async function generateBarcode(api) {
    const request = new Barcode.GetBarcodeGenerateRequest(
        Barcode.EncodeBarcodeType.QR,
        'Aspose.BarCode for Cloud Sample');
        request.textLocation = "None";
        
    const oneBarcode = await api.getBarcodeGenerate(request);

    const fileName = 'QR.png'
    fs.writeFileSync(fileName, oneBarcode.body);

    return fileName;
}

async function recognizeBarcode(api, fileName) {
    const request = new Barcode.PostBarcodeRecognizeFromUrlOrContentRequest();
    request.image = fs.readFileSync(fileName);
    request.type = Barcode.DecodeBarcodeType.QR;
    request.preset = Barcode.PresetType.HighPerformance;
    request.fastScanOnly = true;

    const result = await api.postBarcodeRecognizeFromUrlOrContent(request);

    return result.body.barcodes;
}

const api = new Barcode.BarcodeApi(config);

console.log('Generating barcode...');
generateBarcode(api)
    .then(fileName => {
        console.log('Barcode saved to ' + fileName);

        console.log('Trying to recognize barcode...');
        recognizeBarcode(api, fileName)
            .then(barcodes => {
                console.log('Recognized barcodes are:');
                console.log(JSON.stringify(barcodes, null, 2));
            });
    })
    .catch(err => {
        console.error(JSON.stringify(err, null, 2));
        process.exitCode = 1;
    });

Every method returns a chainable promise.

Licensing

All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed under MIT License.

Resources

Documentation for API Endpoints

All URIs are relative to https://api.aspose.cloud/v3.0/

ClassMethodHTTP requestDescription
BarcodeApigetBarcodeGenerateGET /barcode/generateGenerate barcode.
BarcodeApigetBarcodeRecognizeGET /barcode/{name}/recognizeRecognize barcode from a file on server.
BarcodeApipostBarcodeRecognizeFromUrlOrContentPOST /barcode/recognizeRecognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type "application/octet-stream". An image can also be passed as a form field.
BarcodeApipostGenerateMultiplePOST /barcode/generateMultipleGenerate multiple barcodes and return in response stream
BarcodeApiputBarcodeGenerateFilePUT /barcode/{name}/generateGenerate barcode and save on server (from query params or from file with json or xml content)
BarcodeApiputBarcodeRecognizeFromBodyPUT /barcode/{name}/recognizeRecognition of a barcode from file on server with parameters in body.
BarcodeApiputGenerateMultiplePUT /barcode/{name}/generateMultipleGenerate image with multiple barcodes and put new file on server
FileApicopyFilePUT /barcode/storage/file/copy/{srcPath}Copy file
FileApideleteFileDELETE /barcode/storage/file/{path}Delete file
FileApidownloadFileGET /barcode/storage/file/{path}Download file
FileApimoveFilePUT /barcode/storage/file/move/{srcPath}Move file
FileApiuploadFilePUT /barcode/storage/file/{path}Upload file
FolderApicopyFolderPUT /barcode/storage/folder/copy/{srcPath}Copy folder
FolderApicreateFolderPUT /barcode/storage/folder/{path}Create the folder
FolderApideleteFolderDELETE /barcode/storage/folder/{path}Delete folder
FolderApigetFilesListGET /barcode/storage/folder/{path}Get all files and folders within a folder
FolderApimoveFolderPUT /barcode/storage/folder/move/{srcPath}Move folder
StorageApigetDiscUsageGET /barcode/storage/discGet disc usage
StorageApigetFileVersionsGET /barcode/storage/version/{path}Get file versions
StorageApiobjectExistsGET /barcode/storage/exist/{path}Check if file or folder exists
StorageApistorageExistsGET /barcode/storage/{storageName}/existCheck if storage exists

Keywords

FAQs

Last updated on 25 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc