@ogginger/file
v1.0.1
Published
Crud methods for files.
Downloads
1
Readme
file
Asynchronous CRUD methods for Files.
To Use:
- await new file( "filename", "encoding" [optional - default 'utf8'] ).get();
Methods:
- exists -Checks to see if a file exists. Returns boolean.
- get -Returns the file contents as a string. Throws an error if the filename doesn't exist. 3 create -Takes a string as an argument and creates a file with the given string as the body. Throws an error if the file already exists.
- delete -Deletes the file. Throws an error if the file doesn't exist.
- update -Takes a string as an argument and changes the body of the file to the given string.