# data-lake-file

> ```ts import path from "path"; import DataLake from "../src/mod.js"; import z from "zod"; import NodeAdapter from "../src/adapter/node.js"; import * as url from "url"; export const __dirname = url.fileURLToPath(new URL(".", import.meta.url));

Latest version **1.0.11** (published 2024-05-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install data-lake-file
pnpm add data-lake-file
yarn add data-lake-file
bun add data-lake-file
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.11 |
| Published | 2024-05-12 |
| First published | 2024-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | redchili |

## Links

- npm: https://www.npmjs.com/package/data-lake-file
- npm.io page: https://npm.io/package/data-lake-file

## Dependencies (4)

- [zod](https://npm.io/package/zod.md) ^3.21.4
- [nanoid](https://npm.io/package/nanoid.md) ^3.1.25
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [@redchili/steno](https://npm.io/package/@redchili/steno.md) ^2.0.1

## Recent versions

- 1.0.11 (latest) — 2024-05-12
- 1.0.10 — 2024-04-26
- 1.0.9 — 2024-04-24
- 1.0.7 — 2024-04-23

## README

```ts
import path from "path";
import DataLake from "../src/mod.js";
import z from "zod";
import NodeAdapter from "../src/adapter/node.js";
import * as url from "url";
export const __dirname = url.fileURLToPath(new URL(".", import.meta.url));

const User = z.object({
  name: z.string(),
  age: z.number().int().positive(),
});
const userTable = new DataLake<z.infer<typeof User>>({
  schema: User,
  adapter: new NodeAdapter(path.join(__dirname, "./user.test.json")),
});

async function main() {
  await userTable.load();
  userTable.create({ name: "Jane", age: 23 });

  // console.log(userTable.findById("Atw2ExFczYHIacTOxLxmz"));

  console.log(userTable.findMany({ where: (data) => data.name === "Jane" }));

  // userTable.updateMany({
  //   where: (data) => data.name === "Jane",
  //   data: { age: 36 },
  // });
  userTable.save();
}

main();
```

---
_Source: https://npm.io/package/data-lake-file · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
