file-property v1.0.0
file-property
get property of file.
introduction
This package will help you get the properties of a file, this package has several functions such as name
,size
, extension
,location
, creationDate
.
installation
before you use this package it must first be installed with:
npm install file-property.
usage
const fp = require("file-property")
// your code goes here...
fast documentation
the following are some of the functions available:
fp.name
:taking the name of a file, this function has 2 parameters, namely:
filename
: // file name.withExtensionOrNo
: // filename with extension? (default true)example:
example.js
:```javascript // get file name console.log(fp.name("./test.txt")) // get file name (without extension) console.log(fp.name("./test.txt",false)) ```
fp.size
:taking the size of a file, this function has 2 parameters, namely:
filename
: // filenamemegabytesOrBytes
: // megabytes or bytes? default bytes (true)example: example.js:
```javascript // get file size (in bytes) console.log(fp.size("./test.txt")) // get file size (in megabytes) console.log(fp.size("./test.txt",false)) ```
fp.extension
:taking the extension of a file, this function has 1 parameters, namely:
filename
: // filenameexample:
example.js
:```javascript // get file extension console.log(fp.extension("./test.txt")) ```
fp.location
:taking the location of a file, this function has 1 parameters, namely:
filename
: // filenameexample:
example.js
:```javascript // get file location console.log(fp.location("./test.txt")) ```
fp.creationDate
:taking the creation date of a file, this function has 1 parameters, namely:
filename
: // filenameexample:
example.js
:```javascript // get create date of file console.log(fp.creationDate("./test.txt")) ```
conclusion
that's the file-property documentation thank you for reading
3 years ago