Files
Michael Cartner b9c60b07dc Initial commit
Co-Authored-By: Eric Tuvesson <eric.tuvesson@gmail.com>
Co-Authored-By: mikaeltellhed <2311083+mikaeltellhed@users.noreply.github.com>
Co-Authored-By: kotte <14197736+mrtamagotchi@users.noreply.github.com>
Co-Authored-By: Anders Larsson <64838990+anders-topp@users.noreply.github.com>
Co-Authored-By: Johan  <4934465+joolsus@users.noreply.github.com>
Co-Authored-By: Tore Knudsen <18231882+torekndsn@users.noreply.github.com>
Co-Authored-By: victoratndl <99176179+victoratndl@users.noreply.github.com>
2024-01-26 11:52:55 +01:00
..
2024-01-26 11:52:55 +01:00
2024-01-26 11:52:55 +01:00
2024-01-26 11:52:55 +01:00
2024-01-26 11:52:55 +01:00

Noodl Platform

Cross platform implementation of platform specific features.

Getting Started

When the app is starting we have to set the desired providers.

Electron

// Setup the platform before anything else is loading
// This is a problem since we are calling the platform when importing
import "@noodl/platform-electron";

// Then import the platform etc via:
import { filesystem, platform } from "@noodl/platform";

Node

$ npm install @noodl/platform @noodl/platform-node
// Setup the platform before anything else is loading
// This is a problem since we are calling the platform when importing
import "@noodl/platform-node";

// Then import the platform etc via:
import { filesystem, platform } from "@noodl/platform";

Features

Platform

import { platform } from "@noodl/platform";

platform.getBuildNumber().then((version) => {});

File System

import { filesystem } from "@noodl/platform";

filesystem.readJson("path/to/file.json").then((content) => {
  console.log(content.value);
});

Storage (Config Storage)

This API still needs some love to bring a better universal config system to Noodl.

import { JSONStorage } from "@noodl/platform";

JSONStorage.get("my-key").then((content) => {
  // content = json file
});

JSONStorage.set("my-key", { key: "value" }).then(() => {
  // done
});

JSONStorage.remove("my-key").then(() => {
  // done
});