1.0.29 • Published 1 year ago
force-file-structure v1.0.29
About
A simple node.js package that allows you to force a specific folder/file structure in a given folder while also forcing only specific file types to be used in a given folder.
Installation
npm install --save-dev force-file-structure
Example usage
import watch from 'force-folder-structure';
watch({
root: '/var/www/some-project', // Absolute path where watcher should look for changes
modes: [
'warn', // Prints delete/create actions to console
'delete', // Enables automatic folder/file deletion
'create', // Enables automatic missing folder creation
],
rules: {
// rule for project root directory
'': {
allowedTypes: ['json'], // Only .json files are allowed
},
// rule for /images
'images': {
allowedTypes: ['png', 'jpg', 'svg'],
isRecursive: true, // Enables deep folder/file creation inside this folder such as /images/deep/nested/my-image.png
},
//add as many more rules as you want
},
});
Notes
All dot files such as .gitignore
and node_modules
are ignored by default
1.0.29
1 year ago
1.0.28
1 year ago
1.0.27
1 year ago
1.0.26
1 year ago
1.0.25
2 years ago
1.0.22
2 years ago
1.0.20
2 years ago
1.0.24
2 years ago
1.0.23
2 years ago
1.0.19
2 years ago
1.0.18
2 years ago
1.0.17
2 years ago
1.0.16
2 years ago
1.0.15
2 years ago
1.0.14
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.11
4 years ago
1.0.10
4 years ago
1.0.13
4 years ago
1.0.12
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago