0.3.12 • Published 9 months ago

@itsmworkbench/cli v0.3.12

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Overview

This is about the tenth time I have cut and pasted the same thing.

It's time to make a module that can do this for me!

Config file

Most CLIs have some config. Not all but some. This might be

  • Stored in '~/.xxx.json'
  • Stored in the current directory
  • Stored in a parent directory
  • Stored in a directory xx hanging off a parent directory
  • etc... So many options so we abstract it

Observations

  • We need the config before we build the cli because often we use it in the construction of the cli.
  • Often the config needs validating and errors reporting.
  • We will probably need commands to look at the config and validate it for every CLI we build.
  • We need to build the config... we might add things that aren't serializable to it: this is our dependency injection too

Building the CLI

  • We always need --version. It's hard to do that here so pass it in...
  • We need the config before we build the cli
  • We need to be able to add config commands to the cli (but not do it automatically)

finding your version

In your main file. Because of the use of require it's hard to do this in a library.

export function findVersion () {
  let packageJsonFileName = "../package.json";
  try {
    return require ( packageJsonFileName ).version
  } catch ( e ) {
    return "version not known"
  }
}
0.3.12

9 months ago

0.0.42

1 year ago

0.0.43

1 year ago

0.0.44

1 year ago

0.0.45

1 year ago

0.0.46

1 year ago

0.0.70

1 year ago

0.0.71

1 year ago

0.1.0

1 year ago

0.3.0

12 months ago

0.1.1

1 year ago

0.3.6

12 months ago

0.3.8

12 months ago

0.3.7

12 months ago

0.3.2

12 months ago

0.3.1

12 months ago

0.3.4

12 months ago

0.3.3

12 months ago

0.0.62

1 year ago

0.0.63

1 year ago

0.0.64

1 year ago

0.0.65

1 year ago

0.0.66

1 year ago

0.3.9

12 months ago

0.0.67

1 year ago

0.0.68

1 year ago

0.0.69

1 year ago

0.3.11

11 months ago

0.0.60

1 year ago

0.3.10

11 months ago

0.0.61

1 year ago

0.0.59

1 year ago

0.0.51

1 year ago

0.0.52

1 year ago

0.0.53

1 year ago

0.0.54

1 year ago

0.0.55

1 year ago

0.0.56

1 year ago

0.0.58

1 year ago

0.0.50

1 year ago

0.2.0

1 year ago

0.0.48

1 year ago

0.0.49

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.4

1 year ago

0.0.41

1 year ago

0.0.40

1 year ago

0.0.39

1 year ago

0.0.37

1 year ago

0.0.38

1 year ago

0.0.35

1 year ago

0.0.36

1 year ago

0.0.31

1 year ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

1 year ago

0.0.30

1 year ago

0.0.28

1 year ago

0.0.29

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.21

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.20

1 year ago

0.0.19

1 year ago

0.0.18

1 year ago

0.0.17

1 year ago

0.0.14

1 year ago

0.0.15

1 year ago

0.0.16

1 year ago

0.0.13

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago