1.0.2 • Published 5 years ago

convert-status v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

convert-status

npm version LICENSE

convertStatus is just a simple package to convert fs.Stats objects to more understandable objects

installation

with npm:

npm i convert-status

with yarn:

yarn add convert-status

Stats attrs

interface Status {
    size: string;
    accessedAt: Date;
    modifiedAt: Date;
    changedAt: Date;
    createdAt: Date;
    deviceID: number;
    isOtherExecutable: boolean;
    isOtherReadable: boolean;
    isOtherWriteable: boolean;
    isGroupExecutable: boolean;
    isGroupReadable: boolean;
    isGroupWriteable: boolean;
    isOwnerReadable: boolean;
    isOwnerWriteable: boolean;
    isOwnerExecutable: boolean;
    blockSize: number;
    blocks: number;
    isFile: boolean;
    isDirectory: boolean;
    isBlockDevice: boolean;
    isCharacterDevice: boolean;
    isSymbolicLink: boolean;
    isFIFO: boolean;
    isSocket: boolean;
    deviceIdentifier: number;
    groupIdentifier: number;
    Inode: number;
    hardLinks: number;
    userIdentifier: number;
}

examples

const { convertStatus } =  require('convert-status');
// or
import convertStatus from 'convert-status';

import * as fs from 'fs'

var oldStatus =  fs.statSync('path');
var newStatus = convertStatus(oldStatus);

console.log(newStatus);

License

MIT License

Copyright (c) 2019 AliBasicCoder

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago