An open API service indexing awesome lists of open source software.

https://github.com/lixinyang123/jsdelivrcli

JsDelivr command line Interface 😎 Install and consume 3rd-party client-side libraries from JsDelivr
https://github.com/lixinyang123/jsdelivrcli

cli jsdelivr libary-management nativeaot

Last synced: 11 months ago
JSON representation

JsDelivr command line Interface 😎 Install and consume 3rd-party client-side libraries from JsDelivr

Awesome Lists containing this project

README

          

# JsDelivr command line Interface

Install and consume 3rd-party client-side libraries from jsdelivr.

### Install

Download from Release page.

### Usage

```pwsh
delivr
JsDelivr CLI

Usage:
delivr [options] [command]

Options:
--version Show version information
-?, -h, --help Show help and usage information

Commands:
init Initialize a package configuration file
install install a package from jsdelivr
remove remove a package from local
search search package from npm
info get library version info
restore restore client side package
```

Install a library

```pwsh
install
install a package from jsdelivr

Usage:
delivr [options] install

Arguments:
library name and version

Options:
--version library version
--dir library install directory
-?, -h, --help Show help and usage information
```

Example:

```pwsh
# install jquery
delivr install jquery

# install jquery v3.6.0
delivr install jquery --version 3.6.0

# install jquery v3.6.0 in directory lib
delivr install jquery --version 3.6.0 --dir lib
```

Config library configuration file

```json
{
"Libraries": [
{
"Name": "jquery",
"Version": "3.6.0",
"Destination": "lib"
},
{
"Name": "bootstrap",
"Version": "5.0.2",
"Destination": "lib"
}
]
}
```

Restore dependences

```pwsh
delivr restore
```

### How to Contribute?

Install pre-requisites

- Windows
- Visual Studio 2022, including `.NET workload` and `Desktop development with C++ workload`.

- Linux
- .NET 8 SDK
- libicu-dev
- cmake

##### On Windows

- Visit [official website](https://visualstudio.microsoft.com/) to download Visual Studio 2022.

##### On Linux

- Install .NET SDK
- Ubuntu
```bash
apt install dotnet-sdk-8.0 -y
apt install libicu-dev cmake -y
```

- CentOS
```bash
dnf install dotnet-sdk-8.0 -y
dnf install libicu-dev cmake -y
```

### Restore dependencies

```bash
dotnet restore
```

### Build & Run & Publish

```bash
dotnet build
dotnet run
```

### Publish with NativeAOT

```bash
dotnet publish -r win-x64 -c Release
dotnet publish -r linux-x64 -c Release
dotnet publish -r osx-x64 -c Release
```