shuffle-files

2.0.0 • Public • Published

What is it?

This module synchronously shuffles the names of files in the given directory. It only shuffles the names of files, not the contents of the files. It only shuffles the files with the given extension. Sometimes, some files won't be renamed.

Examples of usage

To shuffle the names of all .txt files in the current directory:

const { shuffleFiles } = require('shuffle-files');
shuffleFiles('./files', 'txt');

To shuffle the names of all .jpg files in the current directory, then rename .png files with the same mapping:

const { shuffleFiles, renameFilesWithMapping } = require('shuffle-files');
const mapping = shuffleFiles('./jpg', 'jpg');
renameFilesWithMapping('./jpg', 'png', mapping);

Readme

Keywords

Package Sidebar

Install

npm i shuffle-files

Weekly Downloads

2

Version

2.0.0

License

ISC

Unpacked Size

4.02 kB

Total Files

6

Last publish

Collaborators

  • pleymor