1.8.6 • Published 3 months ago

fs-generate v1.8.6

Weekly downloads
1
License
MIT
Repository
github
Last release
3 months ago

fs-generate

Utilities to set up file system structures (directories, files, and symlinks).

Provide an object with forward slashes-delimited path keys describing the desired directory structure and it will be created for you.

It will not remove pre-exisiting directories, files, and symlinks so if you need this functionality, please submit a pull request!

Example

var path = require('path');
var generate = require('fs-generate');

var structure = {
  'file1': 'a',
  'file2': 'b',
  'filesymlink1': '~dir3/dir4/file1', // symlink starts with ~
  'dir1': null,
  'dir2/file1': 'c',
  'dir2/file2': 'd',
  'dir3/filesymlink2': '~dir2/file1' // symlink starts with ~
  'dir3/filelink2': ':dir2/file1', // link starts with :
  'dir3/dir4/file1': 'e',
  'dir3/dir4/dir5': null,
  'dir3/dir4/dirsymlink1': '~dir2', // symlink starts with ~
};

generate(path.join(__dirname, 'dest'), structure, function(err) { /* done */ });

/*
- dest
  - file1
  - file2
  - filesymlink1 (symlink  to dir3/dir4/file1)
  - dir1
  - dir2
    - file1
    - file2
  - dir3
    - filesymlink1 (symlink to dir2/file1)
    - filelink1 (link to dir2/file1)
    - dir4
      - file1
      - dir5
      - dirsymlink1 (symlink to dir2)
*/
1.8.6

3 months ago

1.8.5

2 years ago

1.8.4

4 years ago

1.8.3

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

6 years ago

1.0.0

8 years ago