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

nj-campaign-server

v1.1.0

Published

express stack based quiz engine for viber integration

Downloads

6

Readme

Campaign Server

Build Status NSP Status codecov Code Climate Issue Count bitHound Dependencies

express stack based campaign server for viber integration

Table Of Contents

Notes

The API documentation is also available in the git hub repo

Setup and installation

Pre-requirements

  • git and at least read permission for the repository
  • node install v6.8.0 or later
  • npm v3.10.8 or later

Installation

$ git clone [email protected]:gitnooji/quiz-express.git

$ npm install

$ cp env.local .env - env file config for localhost or $ cp env.ec2 .env - env file config for ec2 instance.

Post installation tests

The command below is a simple test to make sure the test framework is operational

$ npm run test-mocha

Now run basic unit tests to make sure the product is installed properly

$ npm test

The server needs to be running for the API tests to work.

$ npm start

open a separate terminal and run the api tests as shown below to make sure the server is correctly configured and receiving messages.

$ npm run api-test-local

congratulations you now have a working campaign-server

Documentation

building the documentation

The following scripts will build the documentation

  • $ npm run docs (clear and re-create all documentation)
  • $ npm run api-docs (create only the api documentation)
  • $ npm run coverage-docs (create only the coverage reports)

To view the created documentation run the documentation server as shown below and navigate to the displayed url.

$ npm run doc-server

   Starting up http-server, serving docs
    Available on:
      http://127.0.0.1:8082
      http://10.1.10.111:8082
    Hit CTRL-C to stop the server

Scripts

The following scripts are defined in package.json

start up
  • $ npm start start quiz-express
  • $ npm run start-dev start inside nodejs-dashboard
  • $ npm run start-debug start quiz-express in debug mode with attached devtools. open chrome at the URI provided and enjoy chrome tools debugging
testing
  • $ npm test run basic test suite
  • $ npm run test-mocha smoke test to make sure mocha is configured
  • $ npm run test-auto watch for file changes and rerun tests
  • $ npm run test-babel run test suite with .babelrc settings
code coverage
  • $ npm run coverage run the code coverage tool. coverage reports are written to the docs folder.
documentation
  • $ npm run docs build all the docs.
  • $ npm run doc-server start the local documentation server.
clean up
  • $ npm clean clean everything and reinstall npm modules
  • $ npm run clean-test clean test artifacts
  • $ npm run clean-docs clean documentation artifacts
  • $ npm run clean-npm remove and re-install npm modules

Environment variables

Environment control vars are defined in the .env file in the root folder of the project. env.local and env.ec2 can be editted and copied to .env

| Variable | Usage | |--------------|:------------------------------------| | API_PORT | The port to run on (default: 8000). | API_URL | The url of the endpoint |API_COMPRESSION | Enables gzip compression when set to "1".| |API_GRACEFUL_SHUTDOWN | Wait for connections to close before stopping server when set to "1". |API_SESSION_MAXAGE | The time in ms until the session ID cookie should expire (default: 2 hours).This is just a tracking cookie, no session storage is used here.| |API_REV_PROXY | The server is behind a reverse proxy when set to "1".| |API_SSL | Use a HTTPS server when set to "1". Enforces HTTPS by redirecting HTTP users when used with a reverse HTTP/HTTPS proxy.| |API_SSL_KEY | Path to the SSL key file.| |API_SSL_CERT | Path to the SSL cert file.| |VIBER_URI | Nooji| |VIBER_DEEPLINK | viber://pa?chatURI=Nooji| |VIBER_AUTH_TOKEN | SECRET |VIBER_WEBHOOK |/| |VIBER_API_URL | https://chatapi.viber.com/pa| |VIBER_SENDER_AVATAR | url|

Miscellanea

Dependencies

The production module dependencies can be viewed with the following command

$ npm ls -l -depth=0 --prod

sample output.

[email protected]
│ /home/davey/Code/nooji.io/quiz-express
│ express stack based quiz engine for viber integration
│ git+https://github.com/gitnooji/quiz-express.git
│ https://github.com/gitnooji/quiz-express#readme
├── [email protected]
│   Node.js body parsing middleware
│   git+https://github.com/expressjs/body-parser.git
│   https://github.com/expressjs/body-parser#readme
├── [email protected]
│   Terminal string styling done right. Much color.
│   git+https://github.com/chalk/chalk.git
│   https://github.com/chalk/chalk#readme
├── [email protected]
│   Loads environment variables from .env file
│   git://github.com/motdotla/dotenv.git
│   https://github.com/motdotla/dotenv#readme
├── [email protected]
│   An opinionated Express Web API server library
│   git+https://github.com/cgmartin/express-api-server.git
│   https://github.com/cgmartin/express-api-server
└── [email protected]
    A light-weight module that brings window.fetch to node.js and io.js
    git+https://github.com/bitinn/node-fetch.git
    https://github.com/bitinn/node-fetch

Development dependencies

You can view the development dependencies of the project with the following command

$ npm ls -depth=0 --dev

References