Necromancers Playing MTG


    1.2.0 • Public • Published

    Package Controller

    Upgrade your NPM package dependencies automatically!

    NOTE: Currently only compatible with gitlab

    Quick Start


    npm i package-controller --save-dev

    Add to your package.json

     "packageController": {
        "only": [
          "MY PACKAGE NAME"
        "exclude": [],
        "skipCi": false


    • Only

      Specify packages you want to upgrade

    • Exclude

      Exclude packages you don't want to upgrade

    • skipCi

      Disabled as default, skips builds in Merge Requests

    GitLab Configuration


    1. Create a Project Access Token
    2. Create a CI/CD Variable
    3. Configure a Repository
    4. Schedule pipeline jobs

    1. Create a Project Access Token

    In your GitLab project go to Settings -> Access Tokens

    Now create a Project Access Token with the following information.

    Name: Package-Controller-AccessToken


    • API
    • read_repository
    • write_repository

    and don't forget to copy the token to a safe place (you will need it for the next step).

    2. Create a CI/CD Variable

    In your GitLab project go to Settings -> CI/CD

    Expand the Variables section and click Add Variable

    Create the variable with the following information:

    Key: Package_Controller_AccessToken

    Value: { Use the Package-Controller-AccessToken VALUE }

    Flags: check Protect variable and Mask variable

    Click Add Variable

    3. Configure a Repository

    Add to your .gitlab-ci.yml file the following code:

       stage: maintenance
       cache: []
          name: brunomartinspro/node-powershell:latest
          entrypoint: [""]
        - npx package-controller 
        - schedules

    If you want to create also an image for your organization like brunomartinspro/node-powershell:latest

    RUN apt-get update \
     && apt-get upgrade -y \
     && apt-get install nodejs -y \
     && apt-get install npm -y \
     && apt-get install curl -y
    RUN apt install git-all -y
    RUN npm install -g n
    RUN n 14.18.1

    run the commands:

    docker build -t .
    docker push

    and update the image name variable with:


    If you are using private repositories this is probably the best approach since you can add to your script the configurations for private repositories, for example:

    # Set URL for your scoped packages.
    # For example package with name `@foo/bar` will use this URL for download
    npm config set @foo:registry
    # Add the token for the scoped packages URL. This will allow you to download
    # `@foo/` packages from private projects.
    npm config set -- '//' "<your_token>"

    NOTE: generally you can replace "<your_token>" with "${CI_JOB_TOKEN}"

    as described in Authenticate with a personal access token or deploy token

    To ignore other jobs from being executed add a rule for each job:

      - schedules

    When you want to ignore other jobs on a specific branch as a manual trigger

    when: manual
      - master
      - schedules

    You may have to include a maintenance stage

      - maintenance

    Also sometimes the pipeline may run in detached mode, this means it won't be building a branch but the merge request itself.

    You may want to add validations for these cases like:

        - merge_requests

    4. Schedule pipeline jobs

    In your GitLab project go to CI/CD -> Schedules

    Click New schedule and set up the schedule to your preferences.

    If you don't have any add preferences:

    Description: Package ControllerInterval

    Pattern: Custom and set to 0 18 * * 4 (Every Thursday at 6 PM every week)

    Cron Timezone: UTC

    Target Branch: master

    Click "Save pipeline schedule".

    That's it, everything should work now!


    npm i package-controller

    DownloadsWeekly Downloads






    Unpacked Size

    17.4 kB

    Total Files


    Last publish


    • brunomartinspro