syntex-filesystem

1.0.2 • Public • Published

SynTex Filesystem

An intelligent file system for reading and writing files.

NPM Recommended Version NPM Beta Version NPM Downloads GitHub Commits GitHub Code Size


Use This In Your Code

let Logger = require('syntex-logger'),
    FileSystem = require('syntex-filesystem');

let logger = new Logger({ pluginName : 'Demo Plugin', language : 'us', debug : true });

logger.setLogDirectory('/var/demo_plugin/logs');

let files = new FileSystem({ logger, baseDirectory : '/var/demo_plugin/' }, { initDirectories : ['example', 'logs'], enableCache : false });

var filePath = '/example/demo.json',
    exampleContent = { a : 1, b : 2 };

files.writeFile(filePath, exampleContent).then((response) => {

    logger.debug(response);

    files.readFile(filePath).then((data) => {
        
        logger.debug(data);

    }).catch((error) => {

        if(error != null)
        {
            logger.err(error);
        }
    });
});

Troubleshooting

GitHub Issues

  • Report us your Issues
  • Join our Discord Server

Discord

Package Sidebar

Install

npm i syntex-filesystem

Weekly Downloads

18

Version

1.0.2

License

ISC

Unpacked Size

8.92 kB

Total Files

4

Last publish

Collaborators

  • syntexdzn