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 🙏

© 2026 – Pkg Stats / Ryan Hefner

api-amg

v1.1.0

Published

Install memcached : https://memcached.org/downloads

Readme

API ❤ AMG

Install memcached : https://memcached.org/downloads

Install mongodb : https://docs.mongodb.com/manual/installation/

Install nodejs : https://nodejs.org/en/download/


/////////////////////////////////////////////////////////////////


# Install generator private api

npm install -g yo
npm install -g generator-rest

# Generate a new PRIVATE API

cd /my-project
mkdir private-api
cd private-api
yo rest

# Generate a new API ENDPOINT inside your project

yo rest:api

# Take private api access token (MASTER_KEY)

nano .env

# Generate documentation

npm run docs

# Start private api

npm run start

# Install AMG

cd /my-project
mkdir rest-api
cd rest-api
npm init
npm i api-amg --save
nano index.js

...

Build a rest api using this module

const Amg = require('api-amg')
const Api = new Amg({
  private_api    : {
    access_token : 'j8jx10hcOvxKP0kNPTEBzofBdfHgjjtZ', // private api access token (MASTER_KEY)
    url          : 'http://localhost:9000'             // private api url
  },
  memcashed : {
    server  : '127.0.0.1:11211', // memcashed server
    options : {},                // memcached options
    update  : 1000               // millisecond update time
  }
})

// User registration:

Api.reg('[email protected]', 'password', 'Igor M')
.then(
  success => console.log(success),
  err     => console.log(err)
)

// {
//   id: '5d88e96aa9a6fe07ef29fbca',
//   name: 'Igor M',
//   picture: 'https://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?d=identicon',
//   email: '[email protected]',
//   createdAt: '2019-09-23T15:48:58.409Z'
// }

// User authorization:

Api.auth('[email protected]', 'password')
.then(
  success => console.log(success),
  err     => console.log(err)
)

// {
//   access_token: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkODhlOTZhYTlhNmZlMDdlZjI5ZmJjYSIsImlhdCI6MTU2OTI1MzgwN30.52CBLLzNvYLvavVrgIFPJ6x0KtwFU1WYNG4u_F0m-iA'
// }

// User authorization check:

Api.check('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVkODhlOTZhYTlhNmZlMDdlZjI5ZmJjYSIsImlhdCI6MTU2OTI1MzgwN30.52CBLLzNvYLvavVrgIFPJ6x0KtwFU1WYNG4u_F0m-iA')
.then(
  success => console.log(success),
  err     => console.log(err)
)

// {
//   id: '5d88e96aa9a6fe07ef29fbca',
//   name: 'Igor M',
//   picture: 'https://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?d=identicon',
//   email: '[email protected]',
//   createdAt: '2019-09-23T15:48:58.409Z'
// }

// Add data:

Api.add('tests', { text: '123' })
.then(
  success => console.log(success),
  err     => console.log(err)
)

// {
//   id: '5d88eac4a9a6fe07ef29fbcb',
//   text: '123',
//   createdAt: '2019-09-23T13:51:16.341Z',
//   updatedAt: '2019-09-23T17:27:55.871Z'
// }

// Get data:

Api.get('tests', { id: '5d88eac4a9a6fe07ef29fbcb' })
.then(
  success => console.log(success),
  err     => console.log(err)
)

// [
//   {
//     id: '5d88eac4a9a6fe07ef29fbcb',
//     text: '123',
//     createdAt: '2019-09-23T13:51:16.341Z',
//     updatedAt: '2019-09-23T17:27:55.871Z'
//   }
// ]

// Update data:

Api.update('tests', '5d88eac4a9a6fe07ef29fbcb', { text: '123456' })
.then(
  success => console.log(success),
  err     => console.log(err)
)

// {
//   id: '5d88eac4a9a6fe07ef29fbcb',
//   text: '123456',
//   createdAt: '2019-09-23T13:51:16.341Z',
//   updatedAt: '2019-09-23T17:27:55.871Z'
// }

Example: https://github.com/garik-code/api-amg/blob/master/example