1.0.0-alpha.3 • Published 2 years ago

ricerco-utils v1.0.0-alpha.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ricerco-utils

C++ bindings for the Ricerco application.

Allows to access OS specific filesystem features which are not present on Node.js applications.

Features

  • Open a native 'Select Folder' dialogue

Install

yarn add ricerco-utils
npm i ricerco-utils

Configure for your needs

Take a look at Cmake-js docs

# modify node_modules/ricerco-utils/package.json file to fit your needs.
  "cmake-js": {
    "runtime": "nw", # "node" | "electron" | "nw"
    "runtimeVersion": "0.59.1",
    "arch": "x64" # "x64" | "ia32" | "arm64" | "arm"
  }
# Then you should rebuild the module or do an 'npm install' to apply the changes.

Usage

const { ricerco_utils } = require("ricerco-utils"); // Electron and other Node apps
const { ricerco_utils } = nw.require("ricerco-utils"); // NW.JS (in some cases, the 'nw.' part can be omitted)

console.log(filemanager.WinSelectFolderDialogue( '--> leave empty <--' )); // The main window remains active while the PickFolder dialogue is showing.
// or
console.log(filemanager.WinSelectFolderDialogue( '--> JS Number with a window PID <--' ));

Example in Electron:

const { ricerco_utils } = require("ricerco-utils");
const folderPath = ricerco_utils.WinSelectFolderDialogue(
    require('electron').remote.getCurrentWebContents().getOSProcessId() // Not tested
);

Example in NW.JS:

const { ricerco_utils } = nw.require("ricerco-utils");
// NW.JS Window does not have a method for obtaining the window handle so
// We use the parent window PID.
const folderPath = ricerco_utils.WinSelectFolderDialogue(
    process.ppid // Important to use ppid instead of pid ; ppid returns the parent window PID.
);

TODO:

  • Implement more APIs.
  • Remove junk.
  • Implement CMake variables to customize the library.
  • MacOS and Linux support.
  • pre-built binaries.

Dependencies (see the vendor folder for more info):

1.0.0-alpha.3

2 years ago

1.0.0-alpha.1

3 years ago

1.0.0-alpha.0

3 years ago

0.1.6

3 years ago

0.1.3

3 years ago

0.1.5

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago