Skip to content

Official JS SDK for integrating WEBDEVPACK tools into your application.

License

Notifications You must be signed in to change notification settings

webdevpack/webdevpack-sdk-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WEBDEVPACK SDK for JavaScript (Node.js)

WEBDEVPACK SDK for JavaScript provides a simple, expressive way to integrate WEBDEVPACK’s tools into your Node.js applications. Easily access web-development utilities, automate workflows, and build faster with a unified JavaScript interface.

The SDK uses modern ES modules and native Node.js APIs (Node 20+).

Install via npm

npm install @webdevpack/webdevpack-sdk-js

Examples

import { Client } from "@webdevpack/webdevpack-sdk";

const wdp = new Client({
  apiKey: "YOUR-API-KEY"
});

// IMAGES

// Optimize images
await wdp.optimizeImage(sourceFilename, targetFilename, 80);

// Convert images
await wdp.convertImage(sourceFilename, targetFilename, "webp", 80);

// Get text from image (OCR)
const result = await wdp.getTextFromImage(sourceFilename, "eng");

// Generate QR Code
await wdp.generateQRCode(text, targetFilename, 500, "webp");

// Generate barcode
await wdp.generateBarcode(text, targetFilename, 500, 300, "webp");

// CODE

// Minify JavaScript code
const result = await wdp.minifyJavaScript(source);

// Minify JavaScript file
await wdp.minifyJavaScriptFile(sourceFilename, targetFilename);

// Minify CSS code
const result = await wdp.minifyCSS(source);

// Minify CSS file
await wdp.minifyCSSFile(sourceFilename, targetFilename);

// WEBSITES

// Get domain WHOIS information
const result = await wdp.domainWhois(domain);

// SECURITY

// Generate password
const result = await wdp.generatePassword(length, true, true, true);

// Generate key pair
const { privateKey, publicKey } = await wdp.generateKeyPair(bits);

// DOCUMENTS

// Convert HTML to PDF
await wdp.convertHTMLToPDF(source, targetFilename);

// Convert HTML file to PDF
await wdp.convertHTMLFileToPDF(sourceFilename, targetFilename);

Requirements

  • Node.js 20+
  • ES modules enabled ("type": "module")

License

This project is licensed under the MIT License. See the license file for more information.

About

Official JS SDK for integrating WEBDEVPACK tools into your application.

Topics

Resources

License

Stars

Watchers

Forks