Getting started
Raoul de Heer edited this page Sep 25, 2022
·
3 revisions
Install Mylas from NPM
npm i mylas
// Or
yarn add mylas
Synchronous functions:
const Mylas = require("mylas");
// Or
import Mylas from "mylas";
// Save string to file
Mylas.saveS("./text.txt", "Hello world!");
// Load string from file
const loadedData = Mylas.loadS("./text.txt");
// Save JSON to file
Mylas.Json.saveS("./text.json", [{test: "Hello world"}]);
// Load JSON from file
const loadedJSON = Mylas.Json.loadS("./text.json");
/// OR
import "mylas/register";
// Save JSON to file
JSON.saveS("./text.json", [{test: "Hello world"}]);
// Load JSON from file
const loadedJSON = JSON.loadS("./text.json");
Explore all features in exports