Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-rename

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-rename

rename files/folders to programming case types

  • 1.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-rename · GitHub license GitHub code size in bytes

Tiny NodeJS package for renaming files/folders to lower, upper, camel, pascal, snake, kebab, train, random case types. Also with cli support.

Installation

  • Cli usage npm i node-rename -g
  • Node package usage npm i node-rename

CLI Examples

Cli help to get full documentation:

node-rename --help

Show files/folders by pattern without renaming them:

node-rename --pattern "./src/**"

Then if you want to rename all files/folders within src directory to kebab case add case option:

node-rename --pattern "./src/**" --type kebab

Add "--log" option to see renaming result without renaming

node-rename --pattern "./src/**" --type kebab --log

Custom renaming config

  1. Init config file node-rename init
  2. Set up config file
  3. Run the config:
node-rename --pattern "./src/**" --config "./rename.config.js" --log

Node package usage

Case type functions:

import { camelCase, kebabCase, lowerCase, pascalCase, randomCase, snakeCase, trainCase, upperCase } from 'node-rename';

upperCase('some sentence!'); // "SOME SENTENCE!"

Rename files and folders:

import { nodeRename } from 'node-rename';

nodeRename({
    pattern: 'src/**/*.ts',
    type: 'pascal', // type is optional, type: undefined, only returns files to rename
});

// Or cusom rename config
nodeRename({
    pattern: 'src/**/*.ts',
    config: (name: string) => name.replace('-', ''),
});

Keywords

FAQs

Package last updated on 11 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc