file-management-simple

    0.0.7 • Public • Published

    file-management

    Simple File Management. Reads json files.

    Install

    $ npm i -g npm
    ▀ ╢█████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    $ npm i --save file-management
    ▀ ╢█████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟

    Usage

    main.js

    /// File Management Reference
    var FileManagement = require('file-management-simple')
     
    /// Test Params For Json
    var MockJson      = {
                        File: './tests/sample/test.json',
                        FileName: 'test.json',
                        FileFolder: './tests/sample',
                        FileContent: { 'value' : 'Sample file content.' }
                      }
     
    /// Is the file foldeer defined resolved
    var folder        = new FileManagement()
                        .setFile(MockJson.File)
                        .File
                        .Folder
     
    /// Is the file name defined resolved
    var file          = new FileManagement()
                        .setFile(MockJson.File)
                        .File
                        .Name
     
    /// Does the file return as string
    var content       = (new FileManagement()
                        .setFile(MockJson.File)
                        .File)
                        .ToString()
     
    /// Does the file return as json
    var jsContent     = (new FileManagement()
                        .setFile(MockJson.File)
                        .File)
                        .ToJson()
                        .value
     
    console.log(`------------------------------------------------js`)
    console.log(`Sample\t${MockJson.File}`)
    console.log(`Folder\t${folder}`)
    console.log(`File\t${file}`)
    console.log(`Content\t${jsContent}`)
     

    Try

     
    $ node main
     
    Sample  : ./tests/sample/test.json
    Folder  : ./tests/sample
    File    : test.json
    Content : Sample file content.

    Test

    $ npm run test
     
    > node tests
     
    Simple Test Tool
    ==================================================
    Instance constractor is ok?
    Success
    --------------------------------------------------
    is there Incrementing semantic versions?
    Success
    --------------------------------------------------
    Is the file Folder defined resolved?
    Success
    --------------------------------------------------
    Is the filename defined resolved?
    Success
    --------------------------------------------------
    Does the file return as json?
    Success
    --------------------------------------------------
     

    Pipeline

    Build Status

    NPM

    Install

    npm i file-management-simple

    DownloadsWeekly Downloads

    2

    Version

    0.0.7

    License

    MIT

    Unpacked Size

    11.4 kB

    Total Files

    11

    Last publish

    Collaborators

    • azmisahin