asort

Renaming files in ascending order

  • asort

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
asort
0.0.17 years ago7 years agoMinified + gzip package size for asort in KB

Readme

asort

Renaming files in ascending order




!Build Statustravis-badgetravis-url !Versionversion-badgeversion-url !Downloadsdownloads-badgedownloads-url !MIT Licensemit-license-badgemit-license-url !Dependency Statusdaviddm-badgedaviddm-url !NSP Statusnsp-badgensp-url !Greenkeeper badgegreenkeeper-badgegreenkeeper-url
!Code of Conductcoc-badgecoc-url
A package helps renaming files in an ascending order. Each renamed file will contain its own index starting from 1.

Pre-requisite

How to use

It can be used as a dependency or as a CLI directly from your favorite terminal.

To use it as a dependency

# Install it as a dependency in your project
npm install --save asort

# Import the package via 'require'
const { asort } = require('asort'); # OR const asort = require('asort').default;

# Import the package with ES module
import asort from 'asort';

To install the CLI

You can choose to either use the CLI directly with npxnpx-url or to install the CLI globally with NPMnpm-url.
\ Please note that as of npxnpx-url is bundled with NPMnpm-url as of the version of 5.2.0npx-the-npm-package-runner-url.
# Use CLI with npx
$ npx asort <command>

# Install globally via NPM
$ npm install -g asort

Commands

  • Show help via -h or --help.

```bash # asort --help $ asort -h ```
  • Show version via -v or --version.

```bash # asort --version $ asort -v ```
  • Rename files

```bash # Rename files in current directory $ asort ./
# Rename files with defined directory path $ asort ~/my-videos/
# Rename files with defined language for sorting files before renaming $ asort ~/my-videos/ -l "ja-JP"
# Rename files with RegExp + replacer function $ asort ~/my-videos/ -r "/^(\\S+)\\s\\S
?(\\d)\\.(\\w+)\$/i" -p "\$1 - \$2.\$3" ```

API reference

asort(dirName, lang = 'en-US', regex, replace)

License

MIT License © Rong Sen Ng