mrkeyoor.com_
Wed 23 Sept 00:35 UTC
npmUtilsupdated 22 Sept 2026

mylas review

Mylas 2.1.14 groups common Node filesystem operations into File, Json, Buf, and Dir helpers. It reads and writes UTF-8 strings, parsed JSON, and buffers; creates parent directories before saves; removes directory trees; and searches upward for node_modules folders. Several operations have synchronous or worker-thread variants, and JSON input can pass through its own comment and trailing-comma stripper. The current release updates the build target and development tooling after a 3-year gap, with no documented new runtime feature. It is a typed convenience layer over Node fs, not an atomic file store or portable browser filesystem.

Verdict

Mylas 2.1.14 installed in 0.7 seconds as 1 package using 1 MB in our sandbox, with 0 audit findings, but its browser bundle failed. It fits Node scripts that value automatic parent creation and its exact grouped API; use node:fs/promises for ordinary I/O, and choose an atomic writer when file integrity matters.

We installed it

Lab card: what happened when we installed mylasScreenshot of mylas documentation
Install✓ · 0.7s1 package on disk · 1 MB
ImportESM import works · require() works · CommonJS package with exports map
Browsern/acould not be bundled for the browser (Node-only code, most likely)
TypesTypeScript types bundled
Known vulns00 critical · 0 high · 0 moderate · 0 low (npm audit)

Answers from our run

Does mylas install cleanly?

Yes. In a fresh container with an empty cache, npm install mylas finished in 0.7s, leaving 1 package and 1 MB on disk. npm audit reported no known vulnerabilities.

Can mylas run in a browser?

Not directly: esbuild could not bundle it for the browser in our run, which normally means it depends on Node built-ins. Use it on the server, or find a browser-targeted alternative.

Does mylas work with both ESM and CommonJS?

Yes. Both import 'mylas' and require('mylas') worked in Node 22 in our run. The package is published as CommonJS with an exports map.

Does mylas include TypeScript types?

Yes, type declarations ship inside the package, so no @types install is needed.

mylas or fs-extra: which should you use?

fs-extra: Choose it for established copy, move, ensure-directory, remove, and JSON helpers beyond Mylas's small surface. Mylas 2.1.14 installed in 0.7 seconds as 1 package using 1 MB in our sandbox, with 0 audit findings, but its browser bundle failed.

When should you not use mylas?

Native node:fs/promises already covers the work. readFile, writeFile, and mkdir with recursive:true avoid another wrapper and expose the full Node API.

API stability3/5File, Json, Buf, and Dir still expose the Promise, callback, synchronous, and worker families documented throughout the 2.1 line. Version 2.1.14 did not announce a runtime redesign. Stability is weakened by awkward edges that can become application contracts: CommonJS default-export interop, the third-position hasComments flag, process-wide changes from mylas/register, automatic parent creation, and a Node 16 engine floor that callers must enforce.
Docs2/5The project wiki inventories File, Json, Buf, and Dir methods with short examples, and bundled declarations expose their signatures. It does not give production guidance for direct non-atomic writes, concurrent readers, one-worker-per-call overhead, CommonJS default shape, automatic directory creation, or prototype mutation through register. The README mostly points elsewhere, and some wiki examples contain helper-name mistakes, so the source remains necessary for risky operations.
Maintenance3/5GitHub shows a push on August 26, 2026, 2 stars, and 6 open issues and pull requests in an unarchived repository. Version 2.1.14 shipped on November 6, 2025 after version 2.1.13 in October 2022. Its release notes are dominated by CI actions, development dependency updates, typo fixes, an updated target, and the version bump. Activity exists, but users have little evidence of sustained runtime feature or bug-fix work.
Ecosystem3/5npm counted 3,219,662 downloads in the latest completed week. Version 2.1.14 has 0 runtime dependencies, bundled declarations, an exports map, and support for Node 16 or newer, so dependency integration is simple. Community signals are much smaller than the download count: GitHub reports 2 stars and 1 fork. The API wraps Node fs and worker_threads and has no browser, edge-runtime, storage-adapter, or plugin ecosystem.

Use it if

  • A Node tool repeatedly saves small text or JSON files into nested paths and should create missing parent directories automatically.
  • One grouped API for strings, buffers, JSON, directory checks, and ancestor node_modules discovery matches an existing codebase.
  • Configuration files use comments and trailing commas, and the team has tests covering Mylas's specific stripping behavior.
  • A measured large JSON operation benefits from moving parse or stringify work into a newly spawned worker thread.
Skip it if

Setup reality

We installed mylas 2.1.14 in a fresh Node 22 Bookworm sandbox. npm finished in 0.7 seconds and left exactly 1 package using 1 MB. The package is 60 KB unpacked with 0 direct and 0 peer dependencies; npm audit reported 0 known vulnerabilities. It requires Node 16 or newer, publishes CommonJS behind an exports map, includes TypeScript declarations, and worked through both require() and ESM import. Our browser build failed because its API depends on Node filesystem and worker modules.

No credentials, native compilation, or config file are involved. Prefer named imports such as File, Json, Buf, and Dir. The aggregate default lives behind CommonJS interop, so its shape can be surprising between transpilers and native ESM. Every save creates parent directories recursively before writing. That is convenient for generated output, but a misspelled path can create a new directory tree before the file operation fails or succeeds.

Text encoding is fixed to UTF-8, and Json.save uses compact JSON.stringify output without indentation, a replacer, schema checks, or atomic replacement. TypeScript generics on Json.load only assert the returned type. For commented JSON through the Promise form, hasComments occupies the third argument, which means passing undefined for the optional callback. Concurrent readers can observe incomplete content because saves target the final path directly.

Worker helpers create 1 new thread per call rather than using a pool. Use them after measuring large parse or stringify work; small files usually pay more startup cost than they save. Dir.rm performs forced recursive deletion, so validate any variable path before calling it. Keep mylas/register out of reusable packages because its prototype changes affect unrelated tests and dependencies.

Patterns

Load a UTF-8 file read-text

import { File } from 'mylas'
const text = await File.load('./notes/today.txt')

File.load always returns UTF-8 text. Use Buf.load when byte preservation matters.

Create parents and save text write-text

import { File } from 'mylas'
await File.save('./output/reports/latest.txt', 'ready\n')

Missing parent directories are created. The final file is written directly, so this is not an atomic replacement.

Assert a JSON result type read-typed-json

import { Json } from 'mylas'
type Config = { port: number; flags: string[] }
const config = await Json.load<Config>('./config/app.json')

The generic does not validate input at runtime; JSON.parse output is trusted as Config.

Parse comments and trailing commas read-commented-json

import { Json } from 'mylas'
const config = await Json.load('./tool.jsonc', undefined, true)

Promise callers must leave the callback position undefined to reach the third hasComments argument.

Save compact JSON write-json

import { Json } from 'mylas'
await Json.save('./state/job.json', { id: 'j_42', done: false })

Json.save uses compact JSON.stringify output and writes in place without locking or atomic rename.

Read and save binary bytes copy-buffer

import { Buf } from 'mylas'
const bytes = await Buf.load('./input/logo.png')
await Buf.save('./output/logo.png', bytes)

Buf.save also creates parent directories. It does not stream large files, so the whole Buffer remains in memory.

Move large JSON parsing to a worker parse-in-worker

import { Json } from 'mylas'
const report = await Json.loadW('./data/large-report.json')

Each loadW call starts a fresh Worker. Measure total latency before applying it to many small files.

Write bytes from a worker save-buffer-worker

import { Buf } from 'mylas'
await Buf.saveW('./output/blob.bin', Buffer.from(payload))

The implementation copies bytes into SharedArrayBuffer before sending them to 1 newly created worker.

Create and check a directory manage-directory

import { Dir } from 'mylas'
await Dir.mk('./var/cache/thumbs')
if (!(await Dir.check('./var/cache/thumbs'))) throw new Error('missing cache')

Dir.mk is recursive. Dir.check confirms path existence, not writability or that the path is a directory.

Constrain a recursive removal remove-generated-directory

import path from 'node:path'
import { Dir } from 'mylas'
const target = path.resolve('./var/cache/thumbs')
if (!target.endsWith('/var/cache/thumbs')) throw new Error('unsafe target')
await Dir.rm(target)

Dir.rm uses forced recursive deletion. Mylas provides no trash, undo, or built-in allowed-root check.

List ancestor dependency folders find-node-modules

import { Dir } from 'mylas'
const locations = Dir.nodeModules({ cwd: process.cwd(), relative: false })
for (const location of locations) console.log(location)

The helper walks toward the filesystem root. Do not treat packages found through a user-controlled cwd as trusted code.

Use named helpers from CommonJS use-commonjs

const { File, Json } = require('mylas')
const text = await File.load('./message.txt')
const data = await Json.load('./data.json')

Named exports avoid the aggregate .default shape and worked in our Node 22 require() check.

Alternatives

PackageRegistryPick it when
fs-extranpmChoose it for established copy, move, ensure-directory, remove, and JSON helpers beyond Mylas's small surface.
jsonfilenpmChoose it when JSON reading and writing is the only need and output formatting options matter.
confnpmChoose it for application configuration that needs managed paths, defaults, migrations, and schema checks.

More utils guides

lru-cache · ajv · type-fest · p-limit · find-up · js-yaml · the whole shelf →

How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.