Command line application (CLI) that allows us to use the Parallel packages manager (ppm), this package manager have the following features:
-
depends: Sets the dependencies of a package
-
install: Installs the specified package and any necessary transient dependencies.
-
uninstall: Uninstalls the specified package and any transient dependencies that are not dependent of other installed packages.
-
list: Lists all the installed packages, including transient dependencies (the order is not important).
We built the Parallel Package manager Command Line Application with Node.js that can be used on Windows, macOS, or Linux. why node.js? Node.js is a great solution for writing CLI apps. Node.js itself has built-in libraries for reading and writing files, launching other applications, and basic network communication.
list of major frameworks and library that was used to build this project.
To clone and run this application.
you'll need Git and Node.js (which comes with npm or use yarn) installed on your computer. From your command line:
- Clone this repo
git clone https://github.com/arturoliduena/parallel-package-manager-cli.git
- Go into the repository
cd parallel-package-manager-cli
- install package
yarn
or
npm install
- running parralel packages manager (ppm)
you can run the script just like any other Node.js application. Try entering the following from the command line. you must be in the project folder to use ppm (local).
node . <command>
or
npm run ppm -- <command>
However, if you want to be able to run it from anywhere. You can install ppm global.
yarn link
or
npm link
or
npm install -g .
This installs your script “globally.” Any commands listed in the bin section of the package.json file will be made available as command line applications. You can now run your script by typing ppm at the command line.
ppm <command>
To uninstall your script, run the following command.
yarn unlink
or
npm unlik
or
npm uninstall -g parallel-cli
- Tip:
- You can list all globally installed Node.js modules using
npm ls -g --depth=0.
- Issues with npm link check here
In the project directory (locally) yarn run ppm <command>
or npm run ppm -- <command>
or node .
or anywhere (globally) ppm <command>
, these commands are interchangeable.
you can run:
Sets the dependencies of a package - depends <name> [options]
ppm depends <name> -d [...dependencies]
option:
-d
or --dependencies
a list of transient dependencies. this option is optional if you don't pass this option the dependency will be set with an empty array of transient dependencies.
e.g:
ppm depends parallel -d react typescript
ppm depends parallel --dependencies react typescript
Install the specified package and any necessary transient dependencies. - install <name>
ppm install <name>
e.g.
ppm install react
Note:
if the package is already installed. a warning There's already a package called "package-name" installed. This command has had no effect.
, will be display
if the package does not exist. an error a package called "package-name" does not exist. This command has had no effect.
, will be display
Uninstall the specified package and any transient dependencies that are not dependent of other installed packages. - uninstall <name>
ppm uninstall <name>
e.g.
ppm uninstall react
Lists all the installed packages, including transient dependencies. - list
ppm list
e.g.
ppm list
display help for command - --help
, -h
ppm --help
Options | Description |
---|---|
-V, --version | output the version number |
-h, --help | display help for command |
to persist the data a file called parallel.json
is created, it holds metadata relevant to the project and it is used for managing the project dependencies and installed packages.
{
"packages": {
"react": [
"loose-envify",
"object-assign"
],
"loose-envify": [
"js-tokens"
],
"js-tokens": [
],
"object-assign": [
],
"typescript": [
],
"parallel": [
"react",
"typescript"
]
},
"installed": [
"react",
"parallel"
]
}