mves

0.1.1 • Public • Published

mves

Build Status npm version

mv ecmascript

mv anything that can be imported by js and have mves automatically resolve import/require statements. This works for js, jsx, scss, css and supports import, require, url statements.

Installation

npm i -g mves

Usage

# example 
mves <input> <output>

Example.

Let's say you have this folder structure, and one.js imports two.js the import statement would look something like import two from '../two/two.js'

.
├── one
│   └── one.js
└── two
    └── two.js

After running

mves one/one.js one.js

Your folder structure now looks like this

.
├── one
├── one.js
└── two
    └── two.js

and that import statement now looks like this import two from './two/two.js'

Todo

  • support import foo from './foo' foo could potentially be foo.js or foo/index.js right now it only supports import foo from './foo.js'

  • better logging for user, right now it prints absolute path of modified file, nicer to print relative to project root or specified scope.

  • support multiple input args just like mv for ex. mv foo bar zed dir will move foo bar and zed into dir

/mves/

    Package Sidebar

    Install

    npm i mves

    Weekly Downloads

    2

    Version

    0.1.1

    License

    ISC

    Last publish

    Collaborators

    • esayemm