@mists/temp v0.0.9
@mists/temp
@mists/temp
is a partial transpile of the GoLang os
module, and can be used for generating temporary test files, directories or both.
Getting Started
Installation
Use npm (or any other package manager) do add this module to your project.
npm i -D @mists/temp
Code
import {FileHandle, tempDir, tempDirWithFiles, tempFile, tempFileOfSize} from '@mists/tempjs';
const dirPath = tempDir({
// ...
}); // will create a temporary folder
const [dirPath, dirs, files] = tempDirWithFiles({
// ...
}); // will create a temporary directory, with multiple subfolerds and files
const fh = tempFile({
// ...
}); // will create a temporary file
const fh = tempFileOfSize({
// ...
size: '20Mb'
}); // will create a temporary file of 20Mb
Documentation
Development
If you have access to the project clone it, otherwise fork it and clone it:
git clone https://github.com/mists-aside/tempjs
# create a new branch if necesary
git create -b new_feature
Code ;)
Requirements
- Please install NodeJs. We support version 10.x and above.
- Please instal a JavaScript/TypeScript IDE
- Visual Studio Code with ITMCDev Babel Extension Pack or ITMCDev TypeScript Extension Pack
- Jetbrains WebStorm
- Vim with neoclide/coc.nvim and HerringtonDarkholme/yats.vim extensions.
- Any other IDE you trust.
Testing
Just run npm run test
.
If you wish to run a single test file, use npm run test:single -- test/file.test.ts
No need to compile tests, mocha is configured to run TypeScript.
Deployment
NPM publishing is done will be done automatically, through .travis.yaml
. Please do not attempt to change the publishig routine.
Authors
- Dragos Cirjan - Initial work - e3683b43282ee4b9d97cd941f2526135b8691d04
See also the list of contributors who participated in this project.
Issues / Support
Add a set of links to the issues page/website, so people can know where to add issues/bugs or ask for support.
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago