1.0.11 • Published 5 years ago

tsougrana v1.0.11

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Tsougrana

A utility tool that assists in moving a js project or extract dependency information.

move configPath

Moves files from one directory to another according to a configuration file called 'resolver.config.js'. During the moving process, all the import/require statements are updated according to the new destination of the required file.

In order to proceed with the move of the files, we have to specify:

  • The absolute path to the source files
  • The absolute path to the destination files
  • A list of mapping rules between the source and the destination.
  • ignoreFiles is a regular expression with the source files that will not be move to the destination (optionally)
  • The source path alias (optionally)
  • The destination path alias (optionally)
OptionDescription
[configPath]The path for the configuration file
--fromBaseSet your local base project path (oldfrom)
--toBaseSet your local base project path (newto)
--verbose [verbose]The log detail level lightheavy (default: "light")
--dryrunLogs the file moves and the missing dependencies without applying any action

example

> npx tsougrana move /Users/user/Documents/tsougrana/resolver.config.js

resolver.config.js

example

module.exports = {
  rules: [
    {
      from: 'src/**',
      to: 'lib/src'
    },
    {
      from: 'src/myFile.js',
      to: 'foo/bar'
    },
  ],
  ignoreFiles: /regex expression,
  aliasFrom: {
    'shared': 'src/shared'
  },
  aliasTo: {
    'shared': 'lib/helpers',
  }
}

dependencies pathPattern --printFormat printFormat --ignoreEmpty --onlyExternal

Get information about the dependencies for each file in a specific path (included sub-folders). You can see all the dependencies for each file, or select only the external dependencies. Feel free to play with the options.

OptionDescription
[pathPattern]The path to the files that will be analyzed. Only absolute paths allowed
--printFormat [printFormat]The print format of the result jsonrawonlyDependencies (default: "json")
--ignoreEmptyStrip off the files with no dependencies
--onlyExternalAdd only the external dependencies

example

> npx tsougrana dependencies "/Users/user/Documents/tsougrana/**/*.js"
> npx tsougrana dependencies "/Users/user/Documents/tsougrana/**/*.js" --printFormat onlyDependencies --onlyExternal
1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago