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

@devtea2025/odio-totam-laboriosam-explicabo

v1.0.0

Published

Downloads

5

Maintainers

tranvuchinh5538tranvuchinh5538

Keywords

dotenvcallfinduppersistentwhichtostringtageslint-pluginflatMapUnderscoreargumentfastclonepyyamlzodstyleelectronconsumeTypeBoxes5ieairbnbdomdependenciesdirinvariantbyteLengthcolorsES8String.prototype.trimrecursiveroute53Array.prototype.flatcolumncjkfunctionsconnectObservablesmrudeepfastlastnested cssmimediffcore-jstakelintsigintschemaserializerquotedefinePropertylistenersArrayBufferinterruptskeysdayjspromisesspec@@toStringTagreactfast-clonequerystringmetadatavaluesrmdirless.jsECMAScript 2015agentwalkingurlES2017trimEndsomenopebcryptcommanderroutervaluehasclassnamesgetOwnPropertyDescriptorhas-owntestingglobalsreducereast-asian-widthESnextnativeYAMLfast-copychaimkdirexit-codettynumberInt32Arraybddconfigbuffertypeerrorlengthworkflowspeedchinesesesrestfulfixed-widthencryptionimportECMAScript 2020eventsECMAScript 5fast-deep-copyStreamses2016fluxmergeconsolenegativecallboundless mixinsquerysuperagenttoSortedObject.getPrototypeOfbytesymlinkRegExp#flagsECMAScript 3ecmascript-0matchAllReactiveExtensionsArray.prototype.filtertrimRightreal-timeuninstallswfregexpcloudwatchpushgetiteratorES6bannerkarmahttpsbuffersloadingmixinsformJSONestreees2017look-upReflect.getPrototypeOfES2022helpersstreamrdsdatestylingpluginregular expressionresolveyupdroptc39requireforEachpreprocessormimetypessharedcloudtrailes7hasOwntimeinputfunctionawesomesaucejapaneseexeccommand-linesafeintrinsicthroatFloat32ArrayArrayBuffer.prototype.slicehashloggingstyled-componentsqueueset0css nestingtypesafei18nbluebirdfseventstypedsigtermopenredactwaitfindLasttextrequestmobilecode pointscallbindsliceutilitiescoresqshotansiUint16ArrayefficientdeterministicmkdirswatchFilefastifynamespruneesdependency managerStyleSheetzeroECMAScript 2021arktypecloudsearchES7mime-dbstartergradients css3mkdirpimportexportObject.entriesfoldercolormulti-packageemojilruinstallinspectwgetregexsyntaxerrorduplexUint8ArrayextensionparentoptionperformancebundlerECMAScript 2022cors[[Prototype]]linuxsignalwafregularsortObjectbreakviewArray.prototype.findLastIndexstoragegatewayPromisecolumnses2018widthasciiliveES2015createasserttouchweaksetgroupbootstrap cssredux-toolkitrandomiamfastcopytapglacierfindSymbolless compilerismacoswordbreakdataviewgenericsebsstdlibchromeeventEmitterECMAScript 2023debugECMAScript 2017jasminecloudfrontaccessorES5throttleTypedArraypromiseparseserializationmake direslintconfigpathObject.isjsinternalslotqueueMicrotaskRxJSRxFloat64Arrayworkerincludeshookformspinnerprettytypeofbatchobjform-validationnodeJSON-Schemaprefixtslibnamerangeerrorstateframeworkfind-upcollection.es6MapwordwrapES2018Uint8ClampedArrayURLSearchParamsuuidtypescriptBigInt64Arrayclass-validatordescriptionappoptimizerec2fsdeep-copyInt16ArraycollectionstringArray.prototype.flattenRFC-6455immerenumerableclassnamepostcss-pluginArrayBuffer#slicetrimcopypipeconcatMapfpsphoneendpointmonorepoutil.inspecttrimLeftcompareMicrosoftjoidescriptorterminalgraphqlassertslinewrapimmutablefunctionalisConcatSpreadableloggerECMAScript 2018middlewarewhatwgjsonpathcomputed-typestypaniondeep-clonewatcherbusyenvironmentscompile lesslazyhigher-orderformattingprototypematchesformatcodesa11yinternal slotregular expressionsargvlogasyncyamlTypeScriptelmfile systemsetPrototypeOfformsonceparentsreducetoStringTagReactiveXrateprocessvalidatejsdiffglobalbeanstalkreduxoptimistsinatrapolyfillWebSocketweakmaparraykeycss lessES2019tapeastflagswritablebrowserslistjsonfullwidthomit_.extendpicomatchprotocol-bufferses6writegetterruntimeexpressionlookbrowserlisttypesameValueZerotermdeletereact-hook-formsidestringifymovedebuggercliobjectcachepatchcsspropertiesdirectoryvpcvalidationpropertycensorshamauthwarningemrvalidStreammomentautoscalingtoArraynodejsclientes-shim APIajvfilecss variabledatastructuredeepcloneargparserfc4122iterationchannelidgroupBystreams2gradients csscharactersWeakMapworkspace:*CSSpackagelinkcryptoprotoconcurrencytypedarrayselasticacheauthenticationeverySetinferencefromcallback$.extendarraysentriesWeakSetmapUint32ArrayjavascriptarraybuffervestHyBitaskcall-boundsuperstructes-abstractECMAScript 2016findLastIndexsharedarraybufferdescriptorsfiltertypedarraytoolscompilereslintconcatjshintES2020ownflatstructuredCloneaccessibilitymapreduceObject.valueselbreact-testing-library__proto__extraes-shimsperformantmakepostcsscryptless csserrorapolloartmodulesunicodeidleclassesnegative zerotddsymlinksawsrm -frpropscheme-validationautoprefixermatchcircularcss-in-jsspinnersECMAScript 6bundlingtyped arrayapinpm256colourstringifierkinesisutilityfull-widthrgbassertionamazonjQuerygdprremovepositiveObservableESlessvariables in cssexithardlinksiteratelesscssinvarsio-tsassignmodulejsxreact-hooksBigUint64Arrayqsequalityindicatorirqpnpm9styleguidetraverseArray.prototype.includessetterpackage.jsonshelllimitedES2016readdeepcopylockfilecoercibleproxykoreanwrapreusefullenvenvironmentbootstrap lessjsdomES3checkIteratorgetoptoperating-systemcommandprotobufInt8ArrayWebSocketsenderbindsymbolcloudformationfigletSymbol.toStringTagparsingURLrm -rfArray.prototype.findLastoutputhttpdefinehandlersstateless.envpreserve-symlinkses8toobjecthooksargsRegExp.prototype.flagsArray.prototype.flatMapescapepredictablegetPrototypeOfvisualstylesheetprivatesequencetoolkitshimboundFunction.prototype.namedatagetintrinsicCSSStyleDeclarationerror-handlingES2023libphonenumberES2021testclonesortedfetchcontainsArraysymbolslimitstableajaxflattenflagvariablesAsyncIteratorawaitwatchingbyteOffsetECMAScript 7signalsdataViewdom-testing-librarywebreadablestreamwatchObject.keyssetImmediateserializesettingsPushtypeseslintpluginsyntaxsimpledbglobschemestylesreplayloadbalancingfast-deep-cloneinstallermochapasswordrapiddynamodbjwtxhrchromiumrmObject.definePropertyes2015shrinkwraprestString.prototype.matchAlltesterprogressl10nsnsshebangupparseravaArray.prototype.containswindowsextendxtermrobustObject.fromEntriestrimStartstreamsratelimiteventDispatcherconfigurablecall-bindprivate datautilemitECMAScript 2019expresslanguagehasOwnPropertystatuss3package managerwalkcurlequalpackagessearchtelephonecharacterjestminimalreadableidentifierstsbrowserponyfillObject.assignguidoffset

Readme

Server Health

NPM

Allows to easily add a /health endpoint to a Fastify, Restify, Express, Hapi or native node http server returning vital information about a service.

Example output

{
  "status": "ok", // overall server status
  "uptime": 3714, // uptime in seconds
  "upSince": "2017-05-12T03:13:06.462Z",
  "service": { // package.json meta data
    "name": "foobarbaz-server",
    "description": "Foo Bar Baz Server",
    "version": "0.14.0",
    "repository": {
      "type": "git",
      "url": "[email protected]:foobarbaz-server.git"
    }
  },
  "connections": { // plugable connection checks
    "mongodb": "ok",
    "redis": "ok",
    "rabbitmq": "ok"
  },
  "env": {
    "nodeEnv": "local",
    "nodeVersion": "v0.10.37",
    "processName": "foobarbazd",
    "pid": 10329,
    "cwd": "/Users/example/foobarbaz-server"
  },
  "git": {
    "commitHash": "c5d7c311ac8b5de7e309e18b821225d471c2cf1d",
    "branchName": "@devtea2025/odio-totam-laboriosam-explicabo-integration",
    "tag": null
  }
}

Usage

Adding the /health endpoint to a restify server

See example/server.js for a complete example. Also check the tests for how to use this with hapi and express.

const restify = require('restify');
const serverHealth = require('@devtea2025/odio-totam-laboriosam-explicabo');

serverHealth.addConnectionCheck('database', function () {
  // determine whether database connection is up and functional
  return true;
});
serverHealth.addConnectionCheck('rabbitmq', function () {
  // determine whether RabbitMQ connection is up and functional
  return true;
});
serverHealth.addConnectionCheck('redis', function () {
  // determine whether Redis connection is up and functional
  return true;
});
const server = restify.createServer();
serverHealth.exposeHealthEndpoint(server);
server.listen(8080, function() {
  console.log('Listening on port 8080');
});

For frameworks other than restify (default) specify the used framework:

const fastify = require('fastify');

const server = fastify();
serverHealth.exposeHealthEndpoint(server, '/health', 'fastify');
server.listen({port: 8080}, function() {
  console.log('Listening on port 8080');
});

Querying from the command line

After adding the server info health endpoint to a service you can do a quick check on its status using curl and jq:

> curl -s http://localhost:8080/health | jq '.status'
"ok"

Filtering the response directly

Instead of filtering the whole response on the client the library also supports filtering server side by specifying a "filter" query string parameter.

Multiple properties can be queried by separating them by comma: filter=status,env.nodeEnv

> curl -s http://localhost:8080/health?filter=status
{"status":"ok"}

Standalone Node Http Health Check Server

For services that do not have an existing Restify, Express, or Hapi Server, you can create a native Node HTTP Server that only has one route, that also provides the same health checks as Restify, Express, and Hapi servers.

const serverHealth = require('@devtea2025/odio-totam-laboriosam-explicabo');
serverHealth.addConnectionCheck('database', function () {
  // determine whether database connection is up and functional
  return true;
});
const options = {
  endpoint: '/health',  // optional and will default to `/health`
};
const nodeServer = serverHealth.createNodeHttpHealthCheckServer(options);
nodeServer.listen(8080);