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

ayapingping-js

v3.0.27

Published

A starter pack framework in NodeJS for building REST API applications.

Downloads

31

Readme

AyaPingPing JS

A starter pack framework in NodeJS for building REST API applications.

npm package

version build language download dependents issue last_commit license

const appjs = require('ayapingping-js')(__dirname);

appjs.get('/my-route', 'myController');

appjs.listen();

Features

  • Using the power of ExpressJS
  • Allows you to use most of ExpressJS operations (using express function)
  • Easy implementation & customization
  • Controller-based routing
  • Focus on simplicity & performance
  • Plugin mechanism (custom plugin & built in plugin)
  • Executable for generating applications project structure quickly (./node_modules/.bin/ayapingping-js-create)

Docs

  • For full documentation, visit the Wiki

Getting started

Installation

ayapingping-js tersedia di NPM package manager. Untuk menginstall, pertama buat dulu folder project Anda dan masuk kedalam folder tersebut:

mkdir my-project
cd my-project

Kemudian, install ayapingping-js dengan perintah berikut:

npm install ayapingping-js

Setelah proses install berhasil, eksekusi perintah berikut untuk membuat working directory dari ayapingping-js:

./node_modules/.bin/ayapingping-js-create

Perintah diatas akan membuat folders dan files baru seperti: app.js, .env, controllers, dll yang dibutuhkan untuk memulai menggunakan ayapingping-js.

Getting the latest version

Gunakan perintah berikut untuk melakukan update ayapingping-js ke versi yang terbaru:

npm update ayapingping-js

Basic usage

ayapingping-js berbasis ExpressJS. Bagi yang familiar dengan ExpressJS tentu akan lebih mudah. Untuk menggunakan ayapingping-js, silahkan install terlebih dahulu sesuai dengan petunjuk installasi diatas. Masuk ke folder project Anda, kemudian buka terminal baru dan eksekusi file app.js menggunakan perintah berikut ini untuk menjalankan aplikasi:

node app.js

Anda juga bisa menggunakan pm2 untuk menjalankan ayapingping-js. Contoh:

pm2 start app.js

Jika berhasil, maka akan muncul keterangan "Application is live!" seperti ini:

https://lh3.googleusercontent.com/pw/ACtC-3fXyv2-V38wmHj798L2v3rf_d_wel3p2qIlZY5QiuW5ugQT_Lt_DM9OitVxRIOR6wwDStl0bmdnyFPu4jmsqBvWRUo2W9rUdPMt_JuoGsQUi4DUp6VRjienxLK3ysuXfv9svqeXNtReyVF7hXYPChR7=w714-h214-no

Anda kemudian dapat melakukan request ke url dan port tersebut—Anda juga bisa test dengan membuka browser ke -> http://localhost:3000.

Simple routing (ayapingping-js style)

Anda bisa membuat route sederhana di app.js dengan format seperti berikut:

appjs.get('/my-route', 'myRouteController');

Kemudian, di folder controller buat file bernama myRouteController.js dan isikan:

'use strict';

module.exports = function(proto, req, res, next) {
  res.send('Hello world!');
};

Route baru berhasil dibuat. Jika Anda mengakses route GET '/my-route', maka Anda akan mendapatkan response "Hello world!".

ayapingping-js adalah controller-based. Jadi setiap route harus memiliki controller untuk menghandle logic utamanya.

Simple routing (ExpressJS style)

Anda juga bisa membuat route di app.js dengan gaya ExpressJS seperti berikut ini:

appjs.express((proto, app) => {
  // ExpressJS style
  app.get('/my-route', (req, res, next) => {
    res.send('Hello world!');
  });
  app.get('/my-route-2', (req, res, next) => {
    res.send('Hello world! Again!');
  });
});

Contributing

Follow the Contributing Guide (updated soon).

People

Thanks to all people who took their time to contribute to this project.

List of all contributors

Release

Changelog

Read at CHANGELOG.md

Credits

Copyright © 2020 - 2021 Dali Kewara

License

MIT License