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

@gapi/cli

v1.8.151

Published

Gapi command line interface

Downloads

751

Readme

This is CLI project related with GAPI graphQL api with typescript Decorators

WIKI

Gapi - Advanced graphql server with typescript decorators

Starter - Basic starter project

Starter-advanced - Advanced starter project

Gapi-angular-client - Gapi Apollo Angular client

To install gapi utility type following command:

npm i -g @gapi/cli

To create new basic project from scratch via CLI type:

gapi new my-project

To create new advanced project from scratch via CLI type:

gapi new my-project --advanced

To create new basic project with microservices from scratch via CLI type:

gapi new my-project --microservices

Available commands

Create new project
gapi new project-name
Start created project.
gapi start
(Uses internally on every restart to introspect api schema check "gapi schema introspect" command)
Can be disabled inside package.json > nodemonConfig > events > restart
With this configuration it will make request to localhost:9000 and will take current API schema then will generate graphql.d.ts based on introspection
  "nodemonConfig": {
    "events": {
      "restart": "sleep 1 && gapi schema introspect"
    }
  },
Start production (it will start pm2 and will use process.yml file inside working directory)
gapi start --prod --pm2
Start production inside Docker(it will start pm2-docker and will use process.yml file inside working directory)
gapi start --prod --docker

Start testing

Run single test iteration
Will take config > test > local configuration inside @gapi/cli.conf.yml
gapi test
Run tests in watch mode
gapi test --watch
Run tests with different environment
It will take configuration from @gapi/cli.conf.yml
You can extend configurations from APP when you write after environment "extends app/my-environment"

Custom testing environments

config:
  app:
    local: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: development
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://localhost:9000/graphql
      TOKEN_TESTING: ''
    prod: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: production
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://182.10.0.101:9000/graphql
      TOKEN_TESTING: ''
    my-environment: 
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: development
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://localhost:9000/graphql
      TOKEN_TESTING: ''
  test:
    my-environment: extends app/my-environment
    local: extends app/local
    prod: extends app/prod
    worker:
      API_PORT: 9000
      API_CERT: ./cert.key
      NODE_ENV: production
      AMQP_HOST: 182.10.0.5
      AMQP_PORT: 5672
      ENDPOINT_TESTING: http://182.10.0.101:9000/graphql
      TOKEN_TESTING: ''
Running with Testing worker environment
gapi test --worker

Running with Production environment

gapi test --prod
Running with custom enviroment
gapi test --my-enviroment

Schema

Schema introspection
It will generate graphql.d.ts file based on given address and output folder
Uses @gapi/cli.conf.yml file
config:
  schema:
    introspectionEndpoint: http://localhost:9000/graphql
    introspectionOutputFolder: ./src/app/core/api-introspection
gapi schema introspect
Available shared commands are:
--verbose - Show better logging