npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gitlab-rest

v0.1.1

Published

GitLab API based on offical API V4

Downloads

6

Readme

gitlab-rest

GitLab API based on offical API v3/v4

If links in this document not avaiable, please access README on GitHub directly.

Description

Get Started

Class

const API = require('gitlab-rest');

let rest = new API({ private_token: 'personal-access-token' });

rest.whoAmI()
    .then(info => {
        // ...
    })
    .catch(err => {
        // ...
    });

Standalone Function

const whoAmI = require('gitlab-rest/whoAmI');
whoAmI({ private_token: 'personal-access-token' })
    .then(info => {
        // ...
    })
    .catch(err => {
        // ...
    });

API

This module is made up of one class and a number of methods which may be members or standalone.

All methods are asynchronous and will return instances of Promise. Hereafter, response means what to be obtained in .then(response => { /* ... */ }).

All methods may be required and invoked by itself as what we see in Get Started, Standalone Function. Actually, if a method is invoked by itself, an instance of class Rest will be created implicitly. In such cases, necessary info required by constructor of class Rest should occur in object options or options.api with the same names.

  • Class Rest(Object api)
    To create an instance of gitlab RESTful API.

    • string api.endpoint OPTIONAL DEFAULT
    • string api.version OPTIONAL
    • string api.access_token OPTIONAL
    • string api.private_token OPTIONAL
  • Promise(true) [<rest>].downloadProject(Object options)
    To obtain meta data of matching groups.

    • object options.api OPTIONAL
    • string options.namespace OPTIONAL
    • string options.project_name OPTIONAL
    • string options.project_id OPTIONAL
    • string options.path
    • string options.ref OPTIONAL
    • string options.target
  • Promise(Object[]) [<rest>].findGroups(Object options)
    To obtain meta data of matching groups.

    • object options.api OPTIONAL
    • string options.search OPTIONAL
  • Promise(Object[]) [<rest>].findObjects(Object options)
    To obtain meta data of matching objects / files.

    • object options.api OPTIONAL
    • string options.project_id
    • string options.path OPTIONAL
    • string options.ref OPTIONAL
    • boolean options.recursive OPTIONAL
  • Promise(Object[]) [<rest>].findProjects(Object options)
    To obtain meta data of matching projects.

    • object options.api OPTIONAL
    • string __options.username OPTIONAL
    • string __options.group_id OPTIONAL
  • Promise(Object) [<rest>].getBlob(Object options)
    To obtain blob data of specified object / file.

    • object options.api OPTIONAL
    • string options.namespace OPTIONAL
    • string options.project_name OPTIONAL
    • string options.project_id OPTIONAL
    • string options.path
    • string options.ref OPTIONAL
  • Promise(Object) [<rest>].getGroup(Object options)
    To obtain details of specified group.

    • object options.api OPTIONAL
    • string options.id
  • Promise(Object) [<rest>].getProject(Object options)
    To obtain details of specified project.

    • object options.api OPTIONAL

    • string options.id

  • Promise(Object) [<rest>].getUser(Object options)
    To obtain details of specified user.

    • object options.api OPTIONAL
    • string options.id
  • Promise(Object) [<rest>].whoAmI(Object options)
    To obtain details of user who owns the token used.

    • object options.api OPTIONAL
  • Promise(Object) [<rest>].whoIsThat(Object options)
    To obtain details of GitLab server.

    • object options.api OPTIONAL

FAQ

  • What is namespace?
    Usernames and groupnames fall under a special category called namespaces.

  • What is ref?
    It may be commit (somebody gets used to call it "commit id"), branch or tag.

References