JSPM

@cpp.js/sample-lib-source

1.0.0-beta.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q30071F
  • License MIT

Cpp.js sample library: simple source library

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cpp.js/sample-lib-source) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    @cpp.js/sample-lib-source

    Cpp.js sample library: simple source library

    NPM version License

    Integration

    Start by installing these package with the following command:

    npm install @cpp.js/sample-lib-source

    To enable the library, modify the cppjs.config.js file as shown below.

    import getDirName from 'cpp.js/src/utils/getDirName.js';
    +import sourceSample from '@cpp.js/sample-lib-source/cppjs.config.js';
    
    export default {
        dependencies: [
    +        sourceSample
        ]
        paths: {
            project: getDirName(import.meta.url),
        },
    };

    Usage

    Below are the steps to use the library in your C++ or JavaScript code.

    Usage in C++ Code

    +#include <cppjs-lib-samplebasic/samplebasic.h>
    
    std::string Native::sample() {
    +    return SampleBasic::sample();
    }
    

    Usage in JavaScript Code (web, with plugin)

    import { initCppJs } '@cpp.js/sample-lib-source/cppjs-lib-samplebasic/samplebasic.h';
    
    const { SampleBasic } = await initCppJs();
    console.log(SampleBasic.sample());