1.1.75 • Published 7 days ago

@pmoscode/node-package-builder v1.1.75

Weekly downloads
17
License
MIT
Repository
gitlab
Last release
7 days ago

The Node Package Builder

This simple helper gets handy if you have to manage multiple package.json versions in one Node project.

So, why would you need that? For example if you have an application, module or ... and you need to run it on different architectures, like amd64, armV6, armV7, ... or you have multiple targets (native, cloud foundry, ...)

With NPB you can easily manage these challenges.

You need NodeJS version > 14.15 or 16.10 or 18.0 or 20.0

Installation

Local installation:

npm install @pmoscode/node-package-builder

or

yarn add @pmoscode/node-package-builder --dev

Global installation:

npm install -g @pmoscode/node-package-builder

or

yarn global add @pmoscode/node-package-builder

Example

package.json

Let's take this as an example:

{
  "name": "my-app",
  "scripts": {
    "start": "node app.js",
    "test": "jest"
  },
  "version": "0.0.1",
  "engines": {
    "node": "0.8.x"
  },
  "license": "MIT"
}

cf.json

Here an example for an imaginary cloud foundry change (place it in "envs" folder by default):

{
  "name": "cf-app",
  "subdomain": "myapp-cf",
  "scripts": {
    "start": "node app.js --some-parameters"
  },
  "dependencies": {
    "something-cf-specific": "1.0.3"
  }
}

After run (from the root of your project)

npb cf

you will get a modified package.json:

{
  "name": "cf-app",
  "scripts": {
    "start": "node app.js --some-parameters",
    "test": "jest"
  },
  "version": "0.0.1",
  "engines": {
    "node": "0.8.x"
  },
  "license": "MIT",
  "dependencies": {
    "something-cf-specific": "1.0.3"
  }
}

Restore original

When you run npb, it will create a backup of the original package.json. To restore this one, just run

npb

CLI parameters

ShortLongDescriptionDefault
--environmentThe name of the environment to apply to package.json__reset__ (to restore the original package.json)
-e--env-dirpath to environment filesenvs
-d--dry-runShows only the result. No modification of package.json donefalse
-b--backup-nameName of the package.json backup file. Restored when calling without any environment.package.json
-i--include-environmentInserts a field into the modified package.json which contains the used environmentfalse
-r--replaceReplaces the package.json instead of a merge. For this, the environment package.json has to be complete.false
-v--verboseSelect level of verbosity (max: 2)0
----versionShows current version--

Code documentation

Here you can find the Code documentation: https://pmoscode.github.io/node-package-builder/

1.1.75

7 days ago

1.1.73

14 days ago

1.1.72

26 days ago

1.1.71

1 month ago

1.1.70

1 month ago

1.1.69

1 month ago

1.1.68

2 months ago

1.1.67

2 months ago

1.1.66

2 months ago

1.1.65

2 months ago

1.1.64

2 months ago

1.1.63

2 months ago

1.1.62

3 months ago

1.1.61

3 months ago

1.1.60

3 months ago

1.1.59

3 months ago

1.1.58

3 months ago

1.1.57

4 months ago

1.1.56

4 months ago

1.1.55

4 months ago

1.1.54

4 months ago

1.1.53

4 months ago

1.1.52

4 months ago

1.1.51

4 months ago

1.1.50

4 months ago

1.1.49

4 months ago

1.1.48

5 months ago

1.1.47

5 months ago

1.1.46

5 months ago

1.1.45

5 months ago

1.1.29

7 months ago

1.1.28

7 months ago

1.1.30

7 months ago

1.1.34

6 months ago

1.1.33

7 months ago

1.1.32

7 months ago

1.1.31

7 months ago

1.1.38

6 months ago

1.1.37

6 months ago

1.1.36

6 months ago

1.1.35

6 months ago

1.1.39

6 months ago

1.1.41

6 months ago

1.1.40

6 months ago

1.1.44

5 months ago

1.1.43

5 months ago

1.1.42

6 months ago

1.1.9

10 months ago

1.1.8

10 months ago

1.1.7

10 months ago

1.1.6

10 months ago

1.1.5

11 months ago

1.1.12

10 months ago

1.1.11

10 months ago

1.1.10

10 months ago

1.1.16

9 months ago

1.1.15

10 months ago

1.1.14

10 months ago

1.1.13

10 months ago

1.1.19

9 months ago

1.1.18

9 months ago

1.1.17

9 months ago

1.1.23

8 months ago

1.1.22

9 months ago

1.1.21

9 months ago

1.1.20

9 months ago

1.1.27

8 months ago

1.1.26

8 months ago

1.1.25

8 months ago

1.1.24

8 months ago

1.1.4

11 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.0.4

2 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago