@askalione/file

Simple utility for working with file path

Usage no npm install needed!

<script type="module">
  import askalioneFile from 'https://cdn.skypack.dev/@askalione/file';
</script>

README

Nodejs-File

Nodejs-File is a simple utility for working with file path.

Usage

const file = require('@askalione/file');
const path = 'C:\\alexey\\dev\\file.js';

Get file name:

var name = file.getName(path); // return "file.js"

Get file name without extension:

var name = file.getNameWithoutExtension(path); // return "file"

Get file info:

var info = file.getInfo(path); // return { name: "file", extension: ".js"}

License

File is open source, licensed under the MIT License.