https://github.com/samthor/fileparts
File object which can have its properties modified independently.
https://github.com/samthor/fileparts
nodejs
Last synced: about 1 month ago
JSON representation
File object which can have its properties modified independently.
- Host: GitHub
- URL: https://github.com/samthor/fileparts
- Owner: samthor
- License: apache-2.0
- Created: 2020-03-26T14:32:30.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-26T09:36:23.000Z (about 4 years ago)
- Last Synced: 2025-10-06T03:43:31.009Z (8 months ago)
- Topics: nodejs
- Language: JavaScript
- Homepage:
- Size: 96.7 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/samthor/fileparts/actions)
Tiny package for a file object which has properties like `extname`, `dirname`, and so on which can be modified independently of a path as a whole.
Install as `fileparts`.
```js
import FileParts from 'fileparts';
const fp = new FileParts('path/to/path');
fp.extname = '.there';
fp.name = 'hello';
console.info(path); // outputs "path/to/hello.there"
console.info('' + fp); // same, .toString() works
```
Exports a `class`.
You could extend it for your own purposes.