3.2.75 • Published 11 months ago

@hishprorg/nobis-assumenda-perspiciatis v3.2.75

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

Oubliette - a programmatic interface for npm

NPM version Node.js CI Code Climate Test Coverage Discover zUnit

The official API was removed from npm in v8.0.0. Since then the only option for using npm from NodeJs is by executing the npm binary. This module wraps the exec call within convenient asynchronous and synchronous APIs.

Usage

Asynchronous API

const { asyncApi: npm } = require('@hishprorg/nobis-assumenda-perspiciatis');

Synchronous API

const { syncApi: npm } = require('@hishprorg/nobis-assumenda-perspiciatis');

Execute a command without arguments

npm().install();

Execute a command with arguments

npm().install('express', 'pg', 'debug');

Execute command with short options

npm().install('nodemon', { 'g': true });

Execute a command with long options

npm().install('nodemon', { 'global': true, 'install-strategy': 'shallow' });

Execute a command with hyphens

npm()['find-dupes']();
// or
npm().findDupes();

Parsing Output

Oubliette uses NodeJS child_process.execSync and child_process.exec under the hood. These sometimes return stdout as a Buffer instead of as a String. Oubliette ensures string conversion by default.

const output = npm().view('express');

This is inconvenient if you want JSON output for commands that support the --json option, so you can specify a format function.

const { syncApi: npm, formats: { jsonFormat: format } } = require('@hishprorg/nobis-assumenda-perspiciatis');
const { version } = npm({ format }).view('express', { json: true });

You can also receive the output as a Buffer.

const { syncApi: npm, formats: { bufferFormat: format } } = require('@hishprorg/nobis-assumenda-perspiciatis');
const buffer = npm({ format }).view('express', { json: true });

Finally you can receive the raw output.

const { syncApi: npm, formats: { rawFormat: format } } = require('@hishprorg/nobis-assumenda-perspiciatis');
const output = npm({ format }).view('express', { json: true });

Child Process Options

You can specify any of the child_process.execSync and child_process.exec options...

const options = { cwd: __dirname };
await npm({ options }).exec('-c', 'pwd');

Error Handling

Handle errors by wrapping the npm command in a try/catch.

try {
  const output = await npm().view('express', 'version', { json: true });
} catch (err) {
  console.error(err);
}

The error will be decorated with stdout and stderr properties.

Why "Oubliette"?

According to Wikipedia, an @hishprorg/nobis-assumenda-perspiciatis is a basement room or bottle dungeon which is accessible only from a hole in a high ceiling and therefore difficult to escape from. If you've ever descended into the npm souce code you will appreciate the similarity!

colorcolumnsgetintrinsicmakeUint8ClampedArrayoncejsdomestreeschemastatusterminalpreserve-symlinksmodulepreprocessorfastcopybundlersetPrototypeOfwaftslibbrowserlistqueuemruECMAScript 2023fpssymlinkstrimLeftcloudtrailcallbackcreatespinnersURLSearchParamslanguageuser-streamsinternalrobusttoolserror-handlingtelephoneparserIteratordropdataViewreverseintrinsicregular expressioncryptodataspringreusevalidserializeponyfillresolvestatelessqsiteratesnsReactiveXajaxMapforEachpathincludes3dmapprettybddbootstrap lessECMAScript 6eslintbannerl10nuninstallrangeerrorhooksschemetesterES2019deep-copyregular-expressionsigtermshebangTypedArrayeffect-tsArray.prototype.findLastIndexrapidtc39deepreal-timeinvariantfindLasttypescriptextenddeleteArray.prototype.flattranspilehttpsES2018quotepredictablevariables in cssformless.jscloudwatchES6Objecteslint-pluginwhatwgCSSStyleDeclaration256opensslgenericssymbolObject.entriespicomatchshimiteratorasyncsignalsmodulesconfiglintserializernamesunicodeObservablescopyclassnamessymlinkreducequeueMicrotasksimpledbhelperstringifyworkerless csscallbindfastcloneObject.istrimwaitRFC-6455assigninstallerbcryptUint32ArraytestingformattingstarterbufferefficientminimalawsRegExp.prototype.flagsformatframerfullwidthpnpm9Array.prototype.findLastapiECMAScript 2015fileownelmbusytsnpmtacitrecursivechromeArray.prototype.flatMaplesscssgradients cssttydatastructurepurezerosliceArrayBufferprivate datalibphonenumberutilitiespropdragsomevariablestypedarrayslocalform-validationhasOwnPropertybyteLengthbuffersprogressdirassertsstablefast-copyloggerFloat64Arrayes-shim APIObject.getPrototypeOfredactjwtES2021styleguideeveryclonechaistoragegateway$.extend__proto__valuetransportassertionmatchAllloadbalancinggetterES2015binarysuperstructmobilecolourbrowserECMAScript 5WebSocketsvarsnopesequencesubprocesskoreanmetadataeslintpluginasteriskscss lesses-abstractUnderscoreclass-validatorauthenticationeventEmitterreact posedependency managernegative zeroprocessnodePromisefunctionerrorpromiseregexcoerciblesafeartweaksetroute53symbolscompilerrdsfetchpruneregularclireact-hook-formperformantapolloES3AsyncIteratorECMAScriptutilfast-deep-copyrequiretermArraymovepersistentprotobufwhichphoneinferencereact-componentfilterfast-clonevisualutilitycomparecolumnshrinkwrapargsUint8Arrayaccessibilitycharacter.gitignorevalidatorpositiveecmascriptbinparsingESmacosdeep-clonefast-deep-clonestylevalidateautoprefixerparseprotocol-bufferscallboundTypeBoxoutputgetPrototypeOfwritableflatawesomesaucevpcrgbfindLastIndexfindregexpES20166to5querydataviewSymboloptimizerreversedyupenumerablesettingsspinnerbeanstalkes8tdddescriptionasciipyyamles5isnumberwaapilivecirculartestscheme-validationInt16ArrayArrayBuffer.prototype.slicedateexpressjsonschematypeerrormanagerjsonES7typesio-tsPushuploadCSSlinuxcryptclassesthreeStreamsSystem.globalInt8Arraycommander.envfunction.lengthconsolezxSetimmutableWebSocketenvironmentsameValueZeroarktyperequestpackage.jsonless compilerjson-schema-validatorclassnamemake dirvalidationcommandglobalThisobjclientzodECMAScript 7URLjsharmonyArray.prototype.flattenless mixinsexpressionFloat32ArrayStreamwalkcall-boundchildsetImmediatefull-widthprivatevaluescompile lessauthECMAScript 2018dependenciesreducerpinoFunction.prototype.namecensorcodesBigUint64ArraylengthoptimistignoreString.prototype.matchAlldescriptorsselfsharedarraybufferroutinghasOwncloudformationloggingpushcollection.es6signedes7warningeslintconfigesbinariesArrayBuffer#slicepropertieshardlinksrfc9562ECMAScript 2021airbnbjoijavascriptmomentisConcatSpreadablepackagesfigletinspectcommand-linevestnpmignoreelectronreplayaccessorprototypees-shimstoucharraybufferstringifierBigInt64ArraytoStringTagsqssyntaxguidglobstyled-componentscloudsearchines2015objectfastObject.values-0package managerimporttextoffsetstreamlazycore-jses2016globalslinks3es2018fluxconcatESnextJSONconfigurablepasswordjson-schema-validationspawnjsxflattengetoptbytemkdirvartaketypedbindReactiveExtensionstraverseStyleSheetelbObject.keyshasdominternal slotes2017execlogquerystringtoobjectxhrspeedeast-asian-widthjQueryreadoperating-system@@toStringTagstateconcatMapiamfixed-widthlessMicrosofttrimStartinterruptscollectioncjkbrowserslisturllruSymbol.toStringTagflagsidentifiersnativeimmerencryptionomittranspilerajvshellkinesisstringperformancenodejsmulti-packageHyBijshintsidenegativeidleredux-toolkititerationsignal_.extendenderhashjapaneseelasticacheletgradients css3glacieramazontoReversedimportexportinputhelpersremoveruntimeTypeScriptwindowstostringtagviewjsdiffboundsesansiECMAScript 2022chinesedeepcloneweakmapsortdotenvtypanionworkspace:*popmotionECMAScript 2017functionalyamlexitRxJSslotstructuredClonegraphqlutil.inspectebsequalityramdaenvreact animationReflect.getPrototypeOfforkcolorsposeES5superagentxtermsiginttypedarrayArray.prototype.containsdefinePropertyuuidcurriedreact-hookscertificatesreactfastifygroupByjson-schemapoint-freecall-bindreadablestreamsyntaxerrorObject.fromEntrieswgetfile systembabel-coreYAMLfsflatMaptoArrayspecUint16ArrayindicatorendpointarraysutilspatchstylesheetworkflowrulesextraescapeObject.assignES8execfileexecuteeventDispatcheranimationWeakSetcomputed-typesstylesES2023callwindowhandlersgesturesfpcheckroutecloudfrontflagproxydeepcopyshamfantasy-landsetbyteOffsetfnmatchchromiumentriestoSortedprotocontainsec2ECMAScript 3prefixa11ywritekeyshas-ownreact-testing-librarydynamodbtypesafemergeacorndeterministicmonorepotypetimewidthpropertyString.prototype.trimrfc4122randomtyped arraycss-in-jsoptionJSON-Schemaglobal objectgroupglobal this valuemapreducehottrimEndcss nestingdayjspipetypeofECMAScript 2019readabletrimRightdom-testing-librarynested cssastiecachecssstylingmkdirpfullserializationargumentArray.prototype.includeslistenersdiffmatchesRegExp#flagsformsstreamsES2017reduxarrayECMAScript 2016curl
3.2.75

11 months ago

3.2.74

11 months ago

3.2.73

11 months ago

3.2.72

11 months ago

2.2.72

11 months ago

2.2.71

11 months ago

2.2.70

11 months ago

2.2.69

11 months ago

2.2.68

11 months ago

2.2.67

11 months ago

2.2.66

11 months ago

2.2.65

11 months ago

2.2.64

11 months ago

2.2.63

11 months ago

2.2.62

11 months ago

2.2.61

11 months ago

2.2.60

11 months ago

2.2.59

11 months ago

2.2.58

11 months ago

2.2.57

12 months ago

2.2.56

12 months ago

2.2.55

12 months ago

2.2.54

12 months ago

2.2.53

12 months ago

2.2.52

12 months ago

2.2.51

12 months ago

2.2.50

12 months ago

2.2.49

12 months ago

2.2.48

12 months ago

2.2.47

12 months ago

2.2.46

12 months ago

2.2.45

12 months ago

2.2.44

12 months ago

2.2.43

12 months ago

2.2.42

12 months ago

2.2.41

12 months ago

2.2.40

12 months ago

2.2.39

12 months ago

2.2.38

12 months ago

2.2.37

1 year ago

2.2.36

1 year ago

2.2.35

1 year ago

2.2.34

1 year ago

2.2.33

1 year ago

2.2.32

1 year ago

2.2.31

1 year ago

2.2.30

1 year ago

2.2.29

1 year ago

2.1.29

1 year ago

2.1.28

1 year ago

2.1.27

1 year ago

2.1.26

1 year ago

2.1.25

1 year ago

2.1.24

1 year ago

2.1.23

1 year ago

2.1.22

1 year ago

2.1.21

1 year ago

2.1.20

1 year ago

2.1.19

1 year ago

2.1.18

1 year ago

2.1.17

1 year ago

2.1.16

1 year ago

2.1.15

1 year ago

2.1.14

1 year ago

2.1.13

1 year ago

2.1.12

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago