@the-/refactor

15.6.0 • Public • Published

@the-/refactor

npm Version

Refactoring tool for the-components

Installation

$ npm install @the-/refactor --save

Usage

'use strict'

const { TheRefactor } = require('@the-/refactor')

async function tryExample() {
  const refactor = new TheRefactor()

  // Example to rename "src/controllers/foo.js" into "src/serverside/fooCtrl.mjs"
  await refactor.rename('src/controllers/*.js', ({ basename }) => ({
    basename: /Ctrl$/.match(basename) ? basename : `${basename}Ctrl`,
    dirname: 'src/serverside',
    extname: '.mjs',
  }))
}

tryExample().catch((err) => console.error(err))

API Guide

See API Guide for more detail

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i @the-/refactor

Weekly Downloads

1

Version

15.6.0

License

MIT

Unpacked Size

125 kB

Total Files

25

Last publish

Collaborators

  • okunishinishi