snr-fshelper

This ia a very simple and minimalistic abstraction on top of NodeJS fs library (actually, on top of promised-io/fs, which is a fs with Promeses)

Usage no npm install needed!

<script type="module">
  import snrFshelper from 'https://cdn.skypack.dev/snr-fshelper';
</script>

README

snr-fshelper

This ia a very simple and minimalistic abstraction on top of NodeJS fs library (actually, on top of promised-io/fs, which is a fs with Promeses)

API of this library is only three methods: getObject, createObject and deleteObject

getObject(path)

This method will accept a path and will return either Array of file names in the folder (in case it is a path to a folder) or a binary Buffer with file contents (in case it is a path to a file)

createObject(path, data)

This method will create a folder if no data will be supplied. Otherwise it will create a file containing data supplied in data argument

deleteObject(path)

This one is simple - it will delete a file or folder at given path