@cpp.js/package-tiff

This package provides the Tiff library compiled with Cpp.js, enabling fast and efficient image processing using the TIFF format. It is built with Cpp.js to provide cross-platform support, leveraging both WebAssembly (WASM) for web applications and native


Keywords
tiff, libtiff, cpp.js-package, webassembly, react-native, bindings, cpp, emscripten, javascript, swig, wasm
License
libtiff
Install
npm install @cpp.js/package-tiff@1.0.0-beta.22

Documentation

Next.js logo

Cpp.js

Bind C++ to JavaScript with no extra code.
WebAssembly & React Native

NPM version License Discussions Issues
CodeQL Linux Build Macos Build Windows Build

Basic Usage

src/index.js

import { initCppJs } from './native/Factorial.h';

const { Factorial } = await initCppJs();
const factorial = new Factorial(99999);
const result = factorial.calculate();
console.log(result);

src/native/Factorial.h

class Factorial {
private:
    int number;

public:
    Factorial(int num) : number(num) {}

    int calculate() {
        if (number < 0) return -1;

        int result = 1;
        for (int i = 2; i <= number; i++) {
            result *= i;
        }
        return result;
    }
};

Prerequisites

To begin building your project with Cpp.js, you鈥檒l first need to install a few dependencies:

  • Docker
  • Node.js version 18 or higher
  • CMake version 3.28 or higher (only required for Mobile development)
  • Xcode (only required for iOS development)
  • Cocoapods (only required for iOS development)

Create a New Project

To set up a new cpp.js project with a minimal starter structure, execute the following command in your terminal:

npm create cpp.js@latest

Integrate Into Existing Project

Integrate cpp.js seamlessly into your existing projects using the appropriate packages for your development needs. Refer to the documentation links for detailed integration guides.

Platform Package(s) Documentation
Standalone cpp.js Learn
Webpack @cpp.js/plugin-webpack, @cpp.js/plugin-webpack-loader Learn
Rollup @cpp.js/plugin-rollup Learn
Vite @cpp.js/plugin-vite Learn
Rspack @cpp.js/plugin-webpack, @cpp.js/plugin-webpack-loader Learn
Create React App (CRA) @cpp.js/plugin-webpack, @cpp.js/plugin-webpack-loader Learn
React Native @cpp.js/plugin-react-native, @cpp.js/plugin-react-native-ios-helper, @cpp.js/plugin-metro, @cpp.js/core-embind-jsi Learn
Expo @cpp.js/plugin-react-native, @cpp.js/plugin-react-native-ios-helper, @cpp.js/plugin-metro, @cpp.js/core-embind-jsi Learn
Node.js cpp.js Learn
Cloudflare Workers cpp.js Learn

Features

License

MIT

Copyright (c) 2024, Bu臒ra Sar谋