9.5.113 • Published 10 months ago

@diotoborg/beatae-culpa v9.5.113

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

@diotoborg/beatae-culpa

NPM version Downloads Build Status Coveralls Status

A dictionary of file extensions and associated module loaders.

What is it

This is used by Liftoff to automatically require dependencies for configuration files, and by rechoir for registering module loaders.

How to use it

Consumers should use the exported extensions or jsVariants object to determine which module should be loaded for a given extension. If a matching extension is found, consumers should do the following:

  1. If the value is null, do nothing.
  2. If the value is a string, try to require it.
  3. If the value is an object, try to require the module property. If successful, the register property (a function) should be called with the module passed as the first argument. Advanced: An optional second argument can be provided to replace the default configuration for a hook.
  4. If the value is an array, iterate over it, attempting step #2 or #3 until one of the attempts does not throw.

API

This module provides two top-level properties: extensions and jsVariants.

Note: This module does not depend on any of the loaders it recommends; instead, end-users are expected to install the hooks they want to use for the file types they want to use. See supported extensions and their hooks in the sections below.

extensions

A mapping of file extensions to modules which provide a require.extensions loader.

File extension keys are all in the format of '.foo' or '.foo.bar' and module loader values are either null if the loader should fallthrough to node's loader, or a string representing the module to be required, an object of { module: 'foobar', register: function }, or an array containing those strings and/or objects.

A sample of an entry containing multiple hooks would look like:

{
  '.ts': [
    'ts-node/register',
    'sucrase/register/ts',
    {
      module: '@babel/register',
      register: function(hook) {
        hook({
          extensions: '.ts',
          rootMode: 'upward-optional',
          ignore: [ignoreNonBabelAndNodeModules],
        });
      },
    },
  ],
}

Supported extensions and their hooks

.babel.js:
  - '@babel/register'
.babel.jsx:
  - '@babel/register'
.babel.ts:
  - '@babel/register'
.babel.tsx:
  - '@babel/register'
.cjs:
  - @diotoborg/beatae-culpa/cjs-stub
.coffee:
  - coffeescript/register
.coffee.md:
  - coffeescript/register
.cts:
  - ts-node/register
.esbuild.js:
  - esbuild-register/dist/node
.esbuild.jsx:
  - esbuild-register/dist/node
.esbuild.ts:
  - esbuild-register/dist/node
.esbuild.tsx:
  - esbuild-register/dist/node
.esm.js:
  - esm
.js:
  - built-in node.js loader
.json:
  - built-in node.js loader
.json5:
  - json5/lib/register
.jsx:
  - '@babel/register'
  - sucrase/register/jsx
.litcoffee:
  - coffeescript/register
.mdx:
  - '@mdx-js/register'
.mjs:
  - @diotoborg/beatae-culpa/mjs-stub
.node:
  - built-in node.js loader
.sucrase.js:
  - sucrase/dist/register
.sucrase.jsx:
  - sucrase/dist/register
.sucrase.ts:
  - sucrase/dist/register
.sucrase.tsx:
  - sucrase/dist/register
.swc.js:
  - '@swc/register'
.swc.jsx:
  - '@swc/register'
.swc.ts:
  - '@swc/register'
.swc.tsx:
  - '@swc/register'
.toml:
  - toml-require
.ts:
  - ts-node/register
  - sucrase/register/ts
  - '@babel/register'
  - esbuild-register/dist/node
  - '@swc/register'
.tsx:
  - ts-node/register
  - sucrase/register/tsx
  - '@babel/register'
  - esbuild-register/dist/node
  - '@swc/register'
.yaml:
  - yaml-hook/register
.yml:
  - yaml-hook/register

jsVariants

The jsVariants is the same mapping as above, but only include the extensions which are variants of JavaScript.

Supported extensions and their hooks

.babel.js:
  - '@babel/register'
.babel.jsx:
  - '@babel/register'
.babel.ts:
  - '@babel/register'
.babel.tsx:
  - '@babel/register'
.cjs:
  - @diotoborg/beatae-culpa/cjs-stub
.coffee:
  - coffeescript/register
.coffee.md:
  - coffeescript/register
.esbuild.js:
  - esbuild-register/dist/node
.esbuild.jsx:
  - esbuild-register/dist/node
.esbuild.ts:
  - esbuild-register/dist/node
.esbuild.tsx:
  - esbuild-register/dist/node
.esm.js:
  - esm
.js:
  - built-in node.js loader
.jsx:
  - '@babel/register'
  - sucrase/register/jsx
.litcoffee:
  - coffeescript/register
.mdx:
  - '@mdx-js/register'
.mjs:
  - @diotoborg/beatae-culpa/mjs-stub
.sucrase.js:
  - sucrase/dist/register
.sucrase.jsx:
  - sucrase/dist/register
.sucrase.ts:
  - sucrase/dist/register
.sucrase.tsx:
  - sucrase/dist/register
.swc.js:
  - '@swc/register'
.swc.jsx:
  - '@swc/register'
.swc.ts:
  - '@swc/register'
.swc.tsx:
  - '@swc/register'
.ts:
  - ts-node/register
  - sucrase/register/ts
  - '@babel/register'
  - esbuild-register/dist/node
  - '@swc/register'
.tsx:
  - ts-node/register
  - sucrase/register/tsx
  - '@babel/register'
  - esbuild-register/dist/node
  - '@swc/register'

License

MIT

starterpackage managerconsoleredirectinstallerterminaltermfilterbrowserjshintreact-hooksphonepolyfillreact animationES3clientprotocol-buffersequalityjsbeanstalkframeworkTypedArrayhandlerbindhashpyyamlreusecoveragedeep-copydotenvlook-upformbinariesjestESnextletloggingcss-in-jspromisees7comparevalidatestreamJSONzerowalknpmignoreeslintconfiguuidwafvalidationtrimnodeObject.getPrototypeOfserializationdeepcopyclassnameschannellookfigletsymboltransformtypedcommand-linewgetFloat32Arraypoint-freeparentses2016has-ownprotobufequalarraysymlinksreverseforkfrommkdirpevery.gitignore_.extenddebuggerelectronenderloggerrulesnegative zerohasOwndomsidequeueMicrotaskhelpershtmlbundlerargvartFunction.prototype.nameRxcurlcolumnsisinspectdynamodbstructuredClonenodejsjasminemkdirsnamesslotcollectiontoobjectespreetoolkitjsonlastglobalsajvbinaryArray.prototype.flattenexpressionformatpackagesfixed-widthflatapistyleguidesuperstructes2015boundvalidatorbyteLengthfast-copyajaxprivate dataconsumedirdescriptionobjecta11yoncesharedarraybufferbundlingpipearraybufferECMAScript 2020getPrototypeOfkoreanes5computed-typesArrayBuffer#sliceargumentservicepnpm9functionshigher-orderString.prototype.matchAllcloudwatchcloudfrontcloudsearchwritablefullacornArray.prototype.findLastES2019prefixio-tstslibpluginHyBihasfeedefficientkinesisfast-deep-clonedependency managercharactersminimalmetadatasource mapdeterministicxmlinvariantRegExp.prototype.flagsgraphqljsdifffastifyURLsortedObject.fromEntriesfssubprocessbusyECMAScript 2021storagegateway6to5springfindLastlogglobalSymbol.toStringTagES2023byteOffsetistanbulECMAScript 2016speedmoveperformancebrowserslistiamtoStringTagrobustdom-testing-librarystyletelephoneemojiworkflowObject.keystacitrequireautoscalinges2018es2017importStreamsagentcopyfunction.lengthcircularform-validationregularcodeslanguagetimeairbnbObject.entriesassertcjkfunctionlockfileposecall-bindrdsasciispinnerArray.prototype.findLastIndexsuperagentmanagerUint16Arraymochatypesafecode pointsloadbalancingassertsi18ncheckparserReactiveXcreateaccessormodulesquerystringconcatMapinstalldescriptorstraverseslicejapaneseArray.prototype.filterlrushammake dirstreamsInt32ArrayownforEachECMAScript 6childdatefpvaluesInt16ArrayavaUint32ArrayisConcatSpreadableReactiveExtensionsflagtoReversedloadingObservabledataViewanimationelbES2015varsuser-streamsnameendpointWebSocketutilitiestrimLeftprototsenvironmentString.prototype.trimlocalcallbindupshimeslint-plugingenericsAsyncIteratorvalueWeakSetArray.prototype.containsbyteWeakMapentriescsstakeeslintJSON-SchematestersinatrachineseStreamincludeswhatwggetjson-schema-validationchaifast-clonereaddebugArray.prototype.includesfindupcachetostringtagvpctouchfetchfind-upimmerfpsinjQuerygetterpackage.jsonES2016dependenciesconcatconfigurabledatatrimRightCSSecmascriptscheme-validationnpmcollection.es6transpileomitparentmatchoptimizerbannerES7webtranspilerlengthcryptoindicatorserverUint8ArrayStyleSheetelasticacheiteratorwalkingbddtypaniontypevalidMapebshookformobjsnsreact poseshellreadablestreamFloat64ArrayremoveclonedropesflatMappackagetestingperformantlintvariablesregular expressionssharedasterisksassertionfastutilitytrimEndArray.prototype.flatprunedefinePropertywaitcallbackYAMLbuffersdefineunicodegetintrinsicstylingtypesxtermes-abstractECMAScript 3findLastIndextapeutilES2020postcss-pluginjoicensortapoutputes-shimscorePushchrome__proto__gdprfastcopytddhttpschromiumtestexecMicrosoftmodulemrufnmatchES2018deletecommanderl10nclass-validatorspawnES6babel-corenumberreal-timefile systemReflect.getPrototypeOfasthelpermobileeventsqueuespinnersreact-hook-formgetOwnPropertyDescriptorrestfulbabelarktypemanipulationinferenceBigUint64ArrayswfintrinsiciecloudtrailRFC-6455deepECMAScript 2015reworkInt8ArraynegativeURLSearchParamsdifffullwidthprivates3internal slotrmdirstylesquoteregexeffect-tsRegExp#flagskarmayupimmutableclisafe-0settingsrequestcore-jsclasseshasOwnPropertyjsdomes6callmockObjectmkdircallboundestreeredactproperty3dnativeguidemrObject.assignyamlRxJSsearchzxwidthsimpledbrouterwhichpropprototyperangeerrorkeysdeep-cloneECMAScript 2017util.inspect
9.4.113

10 months ago

9.5.113

10 months ago

9.3.113

10 months ago

9.3.112

10 months ago

9.3.111

10 months ago

9.3.110

10 months ago

9.3.109

10 months ago

9.3.108

10 months ago

9.3.107

10 months ago

9.3.106

10 months ago

9.3.105

10 months ago

9.3.104

10 months ago

9.3.103

10 months ago

9.3.102

10 months ago

9.3.101

10 months ago

9.3.100

10 months ago

9.3.99

10 months ago

9.3.98

11 months ago

9.3.97

11 months ago

9.3.96

11 months ago

9.3.95

11 months ago

9.3.94

11 months ago

9.3.93

11 months ago

9.3.92

11 months ago

9.3.91

11 months ago

9.3.90

11 months ago

9.3.89

11 months ago

9.3.88

11 months ago

9.2.88

11 months ago

9.2.87

11 months ago

9.2.86

11 months ago

9.2.85

11 months ago

9.2.84

11 months ago

9.2.83

11 months ago

9.2.82

11 months ago

8.2.82

11 months ago

8.2.81

11 months ago

8.2.80

11 months ago

8.2.79

11 months ago

7.2.79

11 months ago

7.2.78

11 months ago

6.2.78

11 months ago

6.2.77

11 months ago

6.2.76

11 months ago

6.1.76

11 months ago

6.1.75

11 months ago

6.1.74

11 months ago

6.1.73

12 months ago

6.1.72

12 months ago

6.1.71

12 months ago

6.1.70

12 months ago

6.1.69

12 months ago

6.1.68

12 months ago

6.1.67

12 months ago

6.1.66

12 months ago

6.1.65

12 months ago

6.1.64

12 months ago

6.1.63

12 months ago

6.1.62

12 months ago

6.1.61

12 months ago

6.1.60

12 months ago

6.1.59

12 months ago

6.1.58

12 months ago

6.1.57

12 months ago

6.1.56

12 months ago

6.1.55

12 months ago

6.1.54

12 months ago

6.1.53

1 year ago

6.1.52

1 year ago

6.1.51

1 year ago

6.1.50

1 year ago

6.1.49

1 year ago

6.1.48

1 year ago

6.1.47

1 year ago

6.1.46

1 year ago

5.1.46

1 year ago

5.1.45

1 year ago

5.1.44

1 year ago

5.1.43

1 year ago

5.1.42

1 year ago

5.1.41

1 year ago

5.1.40

1 year ago

5.1.39

1 year ago

5.1.38

1 year ago

5.1.37

1 year ago

4.1.37

1 year ago

4.1.36

1 year ago

4.1.35

1 year ago

4.1.34

1 year ago

4.1.33

1 year ago

4.1.32

1 year ago

4.1.31

1 year ago

4.1.30

1 year ago

4.1.29

1 year ago

4.1.28

1 year ago

4.1.27

1 year ago

4.1.26

1 year ago

4.1.25

1 year ago

4.1.24

1 year ago

4.1.23

1 year ago

4.1.22

1 year ago

4.1.21

1 year ago

4.1.20

1 year ago

4.1.19

1 year ago

4.1.18

1 year ago

4.1.17

1 year ago

3.1.17

1 year ago

3.1.16

1 year ago

3.1.15

1 year ago

3.1.14

1 year ago

3.1.13

1 year ago

3.1.12

1 year ago

3.1.11

1 year ago

3.1.10

1 year ago

3.1.9

1 year ago

3.1.8

1 year ago

3.1.7

1 year ago

3.1.6

1 year ago

3.1.5

1 year ago

3.1.4

1 year ago

3.1.3

1 year ago

2.1.3

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago