fs-beautifier
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

Installing

Package manager

Using npm:
npm install axios
Using bower:
bower install axios
Using yarn:
yarn add axios
Using pnpm:
pnpm add axios

Guide

Once the package is installed, you can import the library using require approach:
import * as fs_beautifier from 'fs-beautifier';
or
const fs_beautifier = require('fs-beautifier');

All directory files

const {
    all
} = fs_beautifier;

all({
    base: __basedir, //base directory
    directories: ["dir1", "dir1/dir2", "dir2"], //list of directory from base
    useExtension: 'js', //module init extension
    extension: 'js', //file extension
}).catch(error => console.log(error));

From files

Html

const {
    file
} = fs_beautifier;

file.html({
    file: './test/test.css', //file path
    indentSize: 4, //optional
}).catch(error => console.log(error));

Css

const {
    file
} = fs_beautifier;

file.css({
    file: './test/test.css', //file path
    indentSize: 2, //optional
}).catch(error => console.log(error));

Js

const {
    file
} = fs_beautifier;

file.js({
    file: './test/test.css', //file path
    indentSize: 4, //optional
}).catch(error => console.log(error));

Json

const {
    file
} = fs_beautifier;

file.json({
    file: './test/test.css', //file path
    indentSize: 2, //optional
}).catch(error => console.log(error));

With string

Html

const {
    html
} = fs_beautifier;

html({
    data: 'Html string', //some data
    indentSize: 4, //optional
    path: 'path', //if u want to create file
}).catch(error => console.log(error)); //returns Promise

Css

const {
    css
} = fs_beautifier;

css({
    data: 'Css string', //some data
    indentSize: 2, //optional
    path: 'path', //if u want to create file
}).catch(error => console.log(error)); //returns Promise

Js

const {
    js
} = fs_beautifier;

js({
    data: 'Js string', //some data
    indentSize: 4, //optional
    path: 'path', //if u want to create file
}).catch(error => console.log(error)); //returns Promise

Json

const {
    json
} = fs_beautifier;

json({
    data: 'Json string', //some data
    indentSize: 2, //optional
    path: 'path', //if u want to create file
}).catch(error => console.log(error)); //returns Promise

Readme

Keywords

Package Sidebar

Install

npm i fs-beautifier

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

7.79 kB

Total Files

12

Last publish

Collaborators

  • dkmca.npm