Joel Purra: Developer and more


node-ffi-packager logotype, impossible cubes in green

README · Usage · Development · Libraries

node-ffi-packager usage

This is a library package development tool. Full documentation pending.

For using the generated libraries, see node-ffi-libraries and each individual README.md.

Tools

Installation

Install tools, then optionally link executables to a location in your PATH.

cd 'node-ffi-packager'
npm install

ln -s "${PWD}/ffi-packager" "${HOME}/bin/"
ln -s "${PWD}/ffi-packager-list" "${HOME}/bin/"
ln -s "${PWD}/ffi-publisher-git" "${HOME}/bin/"
ln -s "${PWD}/ffi-publisher-git-list" "${HOME}/bin/"

Usage

Note that most default values assume that you are allowed to publish to node-ffi-libraries. Pull requests to increase configurability appreciated!

For lists of libraries

Create a list of libraries in a JSON file.

The master list used for node-ffi-libraries is published in the library-configurations repository.

[
    {
        "name": "zlib",
        "version": "1.2.11",
        "remote": "conan-center"
    },
    ...
]

Package all libraries.

ffi-packager-list <path-to-library-list-json>

Publish all libraries.

ffi-publisher-git-list <path-to-library-list-json>

For individual libraries

Mostly used for debugging.

ffi-packager <conan-remote> <conan-reference>
ffi-publisher-git <library-name> <library-version> <conan-remote>

Example

  • The package is generated in ./package/.
    • Can be referenced locally from package.json in another package.
    • Dependent libraries are loaded automatically from “known” locations.
    • See the generated README.md for a usage example.
  • Optionally publish the contents to Github and/or NPM.
    • See expected naming in the generated README.md.
# NOTE: arbitrary location of your choice.
mkdir "${HOME}/my-ffi-libraries"
cd "${HOME}/my-ffi-libraries"
mkdir 'zlib-v1.2.11'
cd 'zlib-v1.2.11'
ffi-packager 'conan-center' 'zlib/1.2.11@'

node-ffi-packager Copyright © 2020, 2021 Joel Purra. Released under GNU General Public License version 3.0 (GPL-3.0). Your donations are appreciated!