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

@ffras4vnpm/aliquid-officia-asperiores

v1.0.0

Published

Hook into the Node.js `require` function. This allows you to modify modules on-the-fly as they are being required.

Downloads

3

Maintainers

lank831011lank831011

Keywords

immutabletypedarraysArray.prototype.flatMapawaitbcryptreact posepreserve-symlinksinstallerrapidopenterminalaccessorisConcatSpreadablefastcopyJSON-Schemafixed-widthReactiveExtensionseslintconfigeventscheckclassestapnumberpyyamlcollection.es6deepbuffersprotopushmovelrustyleguideshebangdotenvargslistenersECMAScript 2019utilsfullspinnerhookformpromiseencryptionredux-toolkitdom-testing-libraryjesttypeerrorPromisenegativeutility__proto__Object.assignsameValueZeroprotobufoutputgetstreamprivateonceirqidletses2018throatflagssortedttydescriptorscallboundnopepreprocessorRxJSstreams2equalfindanimationredactoptimizerintrinsicprocessTypeScriptshellspecfastpositiveObject.getPrototypeOfcryptbusyargvargumentmatchwindowspasswordmapmkdirsfast-copygdprURLwatchsymbolurltakebundlerramdascheme-validationwalkingdefineProperty3dfindLastIndexhasthreeFloat64ArrayUint8ClampedArrayECMAScript 2017unicodestatusexitdataViewjapaneseECMAScript 2015bufferCSSStyleDeclarationbootstrap lesspackageuuidtaskmrulessloggersymlinksphonepersistentES2017dataviewjoiflatMapsyntaxarktypebyteLengthframerStreamstacitpackage managermergetoolkitwordwrapwhatwgeventDispatcherjson-schema-validatormixinsnpmes7Int8Arrayessuperagentreduxexpresscurriedcoreasyncjsdommochamime-dbtypanioncode pointsmobilecss variableloggingnodeerror-handlinges2016command-lineguidmkdirpSymbolsafedeletewgetgenericsuninstallhttpsfetch6to5interruptsES7class-validatorgradients cssconfigstringArray.prototype.findLasttranspilerchromeless csszeropropertieswordbreakclicloneless compileres-abstractclassnamesbytermdirdiffsidejson-schema-validationpruneArray.prototype.flattenRegExp.prototype.flagsponyfillyupES2021sanitizationthrottleregular expressioncallbindeslintES2019ES2015columnsformeast-asian-widthcss lesspropwidthfast-clonewalkWeakMapmake dirpluginairbnbl10nECMAScript 5trimRightcomputed-typesReactiveXremovepackage.jsoncreateObject.entriesimportparentquoteES2018PushcircularObject.keystoobjectdirectoryquerystringes-shim APIdirSetavasigtermserializeqsfunctionalpromisescharactersconcatcoerciblecommanderbindwaitzodindicatorstyleESESnextfpiterateefficienttestArray.prototype.includesqueuepicomatchbrowsermakeMicrosoftrequireincludesless.jsdependenciesfast-deep-copyfastifysetrobustconcatMap.envawesomesauceminimaljsonfastcloneserializerlinkentriestc39modulepropertymiddlewareimmer_.extendharmonyhelpersobjdayjschannelserializationuser-streamsnegative zerotypesafedataxsscontainsArrayBuffer#slicejQueryenvdomspringglobbabelregularemojieslintpluginregexpprivate datautilitiesIteratorES3rateUnderscoreStreamenderFunction.prototype.namecodesprefixString.prototype.matchAlllesscsssetImmediateECMAScript 2020es2015callbackes8readablelookcompilercss-in-jsstructuredClonees6writablehigher-ordertelephoneObject.definePropertyinstallrangeerrorboundcolourpackagescssoffsetvarutilshrinkwrapHyBistringifyrfc4122foldersequenceassignmonorepoinferencecore-jsflatexit-codeRegExp#flagspostcss-plugingroupByURLSearchParamsnativeJSONReflect.getPrototypeOfFloat32Arrayprotocol-buffersdeterministicmatchespostcsstermextraES2022touchdatenamesi18nclientbundlingjavascriptlintstylesexecmimejasminecryptostablewhichgradients css3CSSdeep-copyBigInt64Arraynamejsworkspace:*Object.valuesinternal slotMaptext0macoskarmaperformantconsoleconsttypeswatcherObject.fromEntriesBigUint64ArraydeepcopyqueueMicrotaskerrorcharacterparseArrayBufferfunctionsprototypeassertspipeoptimistinvarianttimereactutil.inspecthardlinksWeakSetauth[[Prototype]]shamTypeBoxvisualfunctionconfigurablesuperstructcensorcall-bindUint16Arraygraphqlcompile lesspatchtypeofECMAScript 3String.prototype.trimcorslockfilesortiteratortestingisbatchchaicolorvestsliceequalityArrayBuffer.prototype.slicefullwidthestreelazybrowserlistWebSocketsnested cssmulti-packagedeep-clonekeyswatchingeverytrimStartcommandinputfilterkoreantostringtagfilesymlinktypeES5workerform-validationECMAScript 2016

Readme

@ffras4vnpm/aliquid-officia-asperiores

Hook into the Node.js require function. This allows you to modify modules on-the-fly as they are being required.

npm Test status

Installation

npm install @ffras4vnpm/aliquid-officia-asperiores --save

Usage

const path = require('path')
const { Hook } = require('@ffras4vnpm/aliquid-officia-asperiores')

// Hook into the express and mongodb module
new Hook(['express', 'mongodb'], function (exports, name, basedir) {
  const version = require(path.join(basedir, 'package.json')).version

  console.log('loading %s@%s', name, version)

  // expose the module version as a property on its exports object
  exports._version = version

  // whatever you return will be returned by `require`
  return exports
})

API

The @ffras4vnpm/aliquid-officia-asperiores module exposes a single function:

hook = new Hook([modules][, options], onrequire)

When called a hook object is returned.

Arguments:

  • modules <string[]> An optional array of module names to limit which modules trigger a call of the onrequire callback. If specified, this must be the first argument. Both regular modules (e.g. react-dom) and sub-modules (e.g. react-dom/server) can be specified in the array.
  • options <Object> An optional object containing fields that change when the onrequire callback is called. If specified, this must be the second argument.
    • options.internals <boolean> Specifies whether onrequire should be called when module-internal files are loaded; defaults to false.
  • onrequire <Function> The function to call when a module is required.

The onrequire callback will be called the first time a module is required. The function is called with three arguments:

  • exports <Object> The value of the module.exports property that would normally be exposed by the required module.
  • name <string> The name of the module being required. If options.internals was set to true, the path of module-internal files that are loaded (relative to basedir) will be appended to the module name, separated by path.sep.
  • basedir <string> The directory where the module is located, or undefined for core modules.

Return the value you want the module to expose (normally the exports argument).

hook.unhook()

Removes the onrequire callback so that it will not be triggerd by subsequent calls to require().

License

MIT