1.0.1 • Published 2 years ago

gla v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
gitlab
Last release
2 years ago

GitLab-API

ℹ️ ALPHA RELEASE AHEAD, works in progress ⏳


Some useful API for gitlab. Create, delete and list all ( owned ) projects. Javascript ESM module.

ℹ️ Javascript ESM module.


Index of Contents


Installation

  • Install it as a global package.
npm i -g gla
  • Install it as a devDependency module for your project.
npm i -D gla
  • Install it as a dependency module for your project.
npm i gla

ℹ️ Saving the access token to global config file, will turn off the use of the token flag for both, shell and module.
ℹ️ It makes a folder in the home directory /HOME_DIR/.gla, and it saves the file config.json inside it.

Shell Usage

  • Create a project with shell

gla create PROJECT_NAME visibility public token YOUR_ACCESS_TOKEN

  • Delete a project with shell

gla delete PROJECT_ID token YOUR_ACCESS_TOKEN

  • List all projects with shell

gla get projects token YOUR_ACCESS_TOKEN

  • Save access token to global config file with shell

gla config global token YOUR_ACCESS_TOKEN

Functions & Examples

  • Create a project

import { gla } from 'gla'

const response = await gla(
    [ 'create', 'test', 'visibility', 'public', 'token', 'YOUR_ACCESS_TOKEN' ],
    true // silence the std output when using gla as a devDependency|dependency in your project
)
console.log(response)

  • Delete a project

import { gla } from 'gla'

const response = gla(
    [ 'delete', 'PROJECT_ID', 'token', 'YOUR_ACCESS_TOKEN' ],
    true // silence the std output when using gla as a devDependency|dependency in your project
)
console.log(response)

  • List all projects

import { gla } from 'gla'

const response = gla(
    [ 'get', 'projects', 'token', 'YOUR_ACCESS_TOKEN' ],
    true // silence the std output when using gla as a devDependency|dependency in your project
)
console.log(response)

/**
 * It returns an object with these values
 * {
 *      'PROJECT_ID': {
 *          name: 'PROJECT_NAME',
 *          description: 'PROJECT_DESCRIPTION'
 *      },
 * }
 */

  • Save access token to global config file

import { gla } from 'gla'

const response = gla(
    [ 'config', 'global', 'token', 'YOUR_ACCESS_TOKEN' ],
    true // silence the std output when using gla as a devDependency|dependency in your project
)
console.log(response)
1.0.1

2 years ago

1.0.0

2 years ago

0.1.15

2 years ago

0.1.16

2 years ago

0.1.14

2 years ago

0.1.13

2 years ago

0.1.12

2 years ago

0.1.11

2 years ago

0.1.10

2 years ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago