Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dpmland/draco

File and folder multiplatform utils for Deno!
https://github.com/dpmland/draco

deno deno-module filesystem library typescript utils-library

Last synced: 3 months ago
JSON representation

File and folder multiplatform utils for Deno!

Awesome Lists containing this project

README

        

Dpm Logo

## Dpm - Draco :sauropod:

[![Discord](https://img.shields.io/discord/932381618851692565?label=Discord&logo=discord&logoColor=white)](https://discord.gg/Um27YPJKud)
[![Twitter](https://img.shields.io/twitter/follow/dpm_land?label=Dpm%20Land&style=social)](https://twitter.com/intent/follow?screen_name=dpm_land)
[![GitHub license](https://img.shields.io/github/license/dpmland/draco?label=License)](./LICENSE)
![Github Workflow](https://img.shields.io/github/workflow/status/dpmland/draco/CI)

Is a collection of utils for the system, directories, deno and files
informations :p

## Usage

> Draco Info -> Show the os and deno information

```ts
import { dracoInfo } from 'https://deno.land/x/[email protected]/mod.ts';

// Prints the os in was running
console.log(dracoInfo.platform());
// Show the architecture was running
console.log(dracoInfo.arch());
// Show the hostname
console.log(dracoInfo.hostname());
// Show the total memory on the machine
console.log(dracoInfo.memoryTotal());
// Show the memory free on the machine
console.log(dracoInfo.memoryFree());
// Show the memory avaliable
console.log(dracoInfo.memoryAvaliable());

// Shows the deno version running now
console.log(dracoInfo.DenoVersion);
// Shows the deno typescript version
console.log(dracoInfo.DenoTypescript);
// Shows the deno v8 version
console.log(dracoInfo.DenoV8);
```

> Draco Files -> Show the file utils and directory utils.

```ts
import { dracoFiles } from 'https://deno.land/x/[email protected]/mod.ts';

// Show the current directory
console.log(dracoFiles.currentDir());
// Show the cache dir for a application
console.log(dracoFiles.cacheDir('app_example'));
// Show the config dir for a application
console.log(dracoFiles.configDir('app_example'));
// Show the temp directory on the current os
console.log(dracoFiles.tempDir());
// Show the home directory
console.log(dracoFiles.homeDir());

// Check if file or folder exists and return true if exists and false if not
console.log(dracoFiles.exists('./examples/dracoInfo.ts'));
// Write a json file from a object
console.log(
dracoFiles.writeJson('./examples/json_example.json', { data: 'hello' }),
);
```

---

Made with :heart: in :earth_americas: