Skip to content

FFI package for libjpeg v9d: "Libjpeg is a widely used C library for reading and writing JPEG image files.". Available for linux-x86_64, macos-x86_64, windows-x86_64.

Notifications You must be signed in to change notification settings

node-ffi-libraries/node-ffi-library-libjpeg-v9d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-ffi-libraries logotype, impossible cubes in orange

Automatically generated Node.js Foreign Function Interface (FFI) package for libjpeg v9d. It is meant as a base to build feature-rich packages on top of — without the hassle of writing library bindings and building native dependencies.

libjpeg: Libjpeg is a widely used C library for reading and writing JPEG image files.

Bugs? Report them!

Platforms supported in this package

linux-x86_64

Conan package id f2fe22dad08bad39aab2a38cb612e26da46e90c0.

Library dependencies

No library dependencies.

Header files

Library files

macos-armv8

Conan package id 30acef53c04f36d5f9412c84a1b3a7434a1f10fb.

Library dependencies

No library dependencies.

Header files

Library files

macos-x86_64

Conan package id ca6b19bf89270552244fca32806dded803132e76.

Library dependencies

No library dependencies.

Header files

Library files

windows-x86_64

Conan package id 995e0f0b86a651012a3bfca00d60f35ae037db5e.

Library dependencies

No library dependencies.

Header files

Library files

Installation

npm install --save github:node-ffi-libraries/node-ffi-library-libjpeg-v9d#semver:^2.0.1

Example

const { load } = require("@ffi-libraries/libjpeg-v9d");

async function main() {
  // Lazy-loading the library and all dependencies.
  const library = await load();

  // A library might have more than one header file.
  console.dir(library);

  // Lazy-load an individual header file (random example, see output from above).
  const headerLoader = library.headers["./include/jconfig.h"];
  const header = await headerLoader();

  // You can now use the functions and types exported by the header file.
  console.dir(header);

  // Properly unload when done.
  await library.unload();
}

main();

Usage

  • Used from Node.js (Javascript) to call the libjpeg dynamic library (C/C++).
    • No compilation required. All available binaries are included in the package and are loaded automatically.
    • Library header files are included, but most other documentation is not. See instead documentation for libjpeg.
  • The header variable in the above example contains a Javascript object generated from the C/C++ header file.
    • C/C++ constants.
    • FFI typedefs.
    • Bindings to C/C++ functions.
  • See the Node.js FFI tutorial to get started.

Package information


@ffi-libraries/libjpeg-v9d Copyright © 2021 Joel Purra. License: MIT.

About

FFI package for libjpeg v9d: "Libjpeg is a widely used C library for reading and writing JPEG image files.". Available for linux-x86_64, macos-x86_64, windows-x86_64.

Resources

Stars

Watchers

Forks

Packages

No packages published