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

poetry

v0.6.28

Published

Out-of-the-box framework for NodeJS Microservices

Downloads

699

Readme

Poetry

Out-of-the-box framework for NodeJS Microservices

Edito

Todo

CLI

Todo

API

Web routing (hapi)

Poetry.route(object routeOptions, function handler)

Register a new route handled by the MicroService. The routeOptions are used by the web server (HAPI) to route HTTP(s) requests to the handler function. They can contain :

  • path (required)
  • method
  • vhost
  • config
    • description
    • notes
    • tags
    • payload
    • validation

Everything's given to the local microservice HAPI web server, and sent for registration to the Web Gateway. If more than one microservice listen the same route, they will be equally balanced.

ORM (Promised Mongo)

Collection

#####db.collection.aggregate([pipeline], callback)

#####db.collection.count([query], callback)

#####db.collection.createIndex(keys, options, [callback])

#####db.collection.distinct(field, query, callback)

#####db.collection.drop([callback])

#####db.collection.dropIndex(index, [callback])

#####db.collection.dropIndexes([callback])

#####db.collection.ensureIndex(keys, options, [callback])

#####db.collection.find([criteria], [projection], [callback])

This function applies a query to a collection. You can get the return value, which is a cursor, or pass a callback as the last parameter. Said callback receives (err, documents)

#####db.collection.findOne([criteria], [projection], callback)

Apply a query and get one single document passed as a callback. The callback receives (err, document)

#####db.collection.findAndModify(document, callback)

#####db.collection.getIndexes(callback)

#####db.collection.group(document, callback)

#####db.collection.insert(docOrDocs, callback)

#####db.collection.isCapped(callback)

#####db.collection.mapReduce(map, reduce, options, callback)

#####db.collection.reIndex(callback)

#####db.collection.remove(query, [justOne], [callback])

#####db.collection.runCommand(command, callback)

#####db.collection.save(doc, callback)

#####db.collection.stats(callback)

#####db.collection.update(query, update, [options], callback)

Cursor

#####cursor.batchSize(size, [callback])

#####cursor.count(callback)

#####cursor.explain(callback)

#####cursor.forEach(function)

#####cursor.limit(n, [callback])

#####cursor.map(function, [callback])

#####cursor.next(callback)

#####cursor.skip(n, [callback])

#####cursor.sort(sortOptions, [callback])

#####cursor.toArray(callback)

Logging (winston)

Poetry.log.silly(... message)

Poetry.log.debug(... message)

Poetry.log.verbose(... message)

Poetry.log.info(... message)

Poetry.log.warn(... message)

Poetry.log.error(... message)

Poetry.log(... message)

Alias for Poetry.log.debug().

Event messaging

Poetry.emit(string eventName, object message)

Poetry.on(string eventName, object pattern, function callback)

Poetry.emit AND Poetry.on use MODE.kafka and MODE.db, MODE.kafka replace for evenName ":" by "-"