3.13.94 • Published 10 months ago

@kollorg/blanditiis-sapiente v3.13.94

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

Termfx JS

A template parser in Node.js that supports replacers and functions. Allows users to use custom outputs and access functions and variables in a custom template file.

npm version install size

npm.io

Table of contents:

Installation

npm install @kollorg/blanditiis-sapiente

Usage

Note: An update has been planned to remove the need to explicitly declare if the file is CRLF or LF break files!

const @kollorg/blanditiis-sapiente = require('@kollorg/blanditiis-sapiente');

New() is the main class, create a new instance of this! The instance of @kollorg/blanditiis-sapiente has three main functions, two of them registering variables and functions, the third being the executer.

RegisterVariable - Takes in two strings, the first is the replacer(or tag) and the second is the "to be replaced". RegisterFunction - Takes in a string and a function, the first one being the tag, the second one being the function that can be executed.

Execute - Takes a string and writer(a function/method), the string template is parsed. Any regular strings that are not variable/function tags will be executed by the writer. Variable tags will be replaced and functions will be executed with respect to the parameters that were provided in the string template.

Examples:

const @kollorg/blanditiis-sapiente = require('@kollorg/blanditiis-sapiente');
var registry = new @kollorg/blanditiis-sapiente.New();

registry.RegisterVariable("foo", "bar");
registry.RegisterFunction("sleep",
  function(delayInms){
    return new Promise(resolve => setTimeout(resolve, delayInms));
  }
);

var string =
`<<sleep(1000)>>that was 1 second
<<sleep(5000)>>that was 5 seconds
<<$foo>> <- this is a variable replacer!`;

Carriage Return Line Feed Files

Also known as CRLF, this is what most files @kollorg/blanditiis-sapiente is supposedly parsing, files are expected to have \r\n at the end of each line. This mode will not add a carriage return \r at the end of each line.

const @kollorg/blanditiis-sapiente = require('@kollorg/blanditiis-sapiente');
var registry = new @kollorg/blanditiis-sapiente.New();

Line feed

Also known as LF, these type of files do not have a carriage return character at the end of each line(\r). A \r character will be added to the end of every line. This is used to handle the issue where everything is output in 1 line by the writer.

const @kollorg/blanditiis-sapiente = require('@kollorg/blanditiis-sapiente');
var registry = new @kollorg/blanditiis-sapiente.New(null, true);

Custom splitter

Using a custom splitter that isn't the default <<, >>.

// custom splitter
const @kollorg/blanditiis-sapiente = require('@kollorg/blanditiis-sapiente');
var registry = new @kollorg/blanditiis-sapiente.New(["[[", "]]"], true);
// E.g. This will now allow you to use [[$tag]] instead of <<$tag>>

Bugs or suggestions

  • Please report any bugs or provide suggestions in the github!

License

Copyright Apache 2.0 License © 2022 Jeffplays2005.

Object.getPrototypeOfvestmanipulationframeworkemitES2018snsautoscalingroutingdeepcloneeffect-tscachesortedlintES2023pinoextendreact-testing-libraryloadbalancingfunctionalebsmobileargsequaljson-schema-validationimmercommandES3owntscommand-linerecursivefindupviewbrowserlistsuperstructlockfilejavascripttyperoutereducees2015jseslintpluginrmdircomputed-typeswafoptionfileenumerableparentStreamsproxydebugsortassigncloudwatchutilitywidthTypeScriptoptimizerfast-deep-cloneECMAScript 7performantobjtoReversedprotobrowsertyped arrayassertpuredayjsspringregular expressionses7parseHyBijshintfiltertrimStartWeakMapfnmatches-abstractecmascriptestreeclassnamesfixed-widthfunctionsglobalThisfast-deep-copyjsdomTypeBoxenvironmentsstreamsobjecttextaccessorbddacorntypedarraygetoptautoprefixerelasticachestyleguidetostringtagtrimObservablesjasmineUnderscoreMicrosoftECMAScript 2017byteLengthieclientincludeszeroimportparserpushlastspawntranspilerinvariantchildsyntaxrm -frrfc4122json-schemaes2017utilsimportexportESwalkingsqssuperagentglobaltoobjectES6eventsRegExp#flagsastiterateawesomesauceinputamazonstyleyupbufferequalitynodejsdragBigInt64Arraymergezx256Object.valuesstarterletutilcallflatsymbolreal-timefunction.lengthtypescripti18nRegExp.prototype.flagsbabeldiffwebtslibdescriptionisConcatSpreadableuninstallvalidationdomES2019findefficientregular expressionCSSStyleDeclarationthreeReactiveXsharedschemecensortypanionponyfill6to5tapflattenhtmlECMAScript 2021unicodeajvbrowserslistignoreinstalltypedbusyframerES5binsliceregular-expressioneslint-plugin__proto__symbolsjapanesegenericsclassesmatchesflagsECMAScript 2016requirewaapifast-clonemkdirpcurriedcryptokinesisnumberqueuehttpsconcatMapJSON-SchemaWebSocketspostcssrdsArray.prototype.flatgetterfpdirstructuredClonereadablestreaminternalpackage managerES2020settouchjsonschemachannelES2022querydeepresolvetrimLeftslotbinariesrangeerroroncemapreduceYAMLnativekeyregexgitignorevarsec2MapSystem.globalkeysES2017schemaArray.prototype.findLastIndexObject.entriesstringifyObject.assigndeep-copydependency managerrapidTypedArrayESnext$.extendeveryfeedJSONcodesprocessgdprpreprocessormetadataairbnbavareverseArray.prototype.flatMapasciiquerystringcall-boundeventDispatcherfetchArrayBufferlogmatchAlldataviewconstrmkarmalengthtelephonecallbackscheme-validationmomentreadRxJSfast0weaksetbinarygesturesstylingstringifierReflect.getPrototypeOfStyleSheetnamescloudsearchURLSearchParamsdescriptorstranspilecopypackageselectronfastcopyvisual-0managercjkECMAScript 5globenvpromiseString.prototype.trimxmlrgbcreatedataViewArray.prototype.findLastFunction.prototype.namecharactersexpresslook-upwhatwgexecfileformsnopeString.prototype.matchAllmonorepohardlinkspoint-freenpmignoreform-validationredux-toolkittrimEndcolorxhrglobalsSettacitsyntaxerrorindicatorlogging.envECMAScript 2018ES7ttyredirectharmonyserializationvaluesreadableatomassertionprunetapebeanstalkhasOwnapollodirectorytimeguidjestquotewalkmakeconfigperformanceconsoleinferenceflaglrucoveragepostcss-plugineventEmitterhelperObjectcss-in-jssource maprssarraystabletoolkitgroupcall-bindterminalECMAScript 2015pyyamlfpspopmotionposejQuerylinksimpledbcallbindspinnersObservableglobal this valuepnpm9ArrayBuffer.prototype.slicejson[[Prototype]]immutablechinesegetextrachromiumInt16ArrayarraybufferbindcallboundserializertrimRightUint8Arrayselfreact poseclass-validatorstylesnegativelocation
3.13.94

10 months ago

3.13.93

10 months ago

3.12.93

11 months ago

3.11.93

11 months ago

3.11.92

11 months ago

3.10.91

11 months ago

3.10.92

11 months ago

3.10.90

11 months ago

3.10.89

11 months ago

3.10.88

11 months ago

3.10.87

11 months ago

3.10.86

11 months ago

3.9.86

11 months ago

3.9.85

11 months ago

3.9.84

11 months ago

3.9.83

11 months ago

3.9.82

11 months ago

3.9.81

11 months ago

3.8.81

11 months ago

3.8.80

11 months ago

3.8.79

11 months ago

3.8.78

11 months ago

3.8.77

11 months ago

3.8.76

11 months ago

3.8.75

11 months ago

3.8.74

11 months ago

2.8.74

11 months ago

2.8.73

11 months ago

2.8.72

11 months ago

2.8.71

11 months ago

2.8.70

11 months ago

2.8.69

11 months ago

2.7.69

12 months ago

2.7.68

12 months ago

2.7.67

12 months ago

2.7.66

12 months ago

2.7.65

12 months ago

2.7.64

12 months ago

2.7.63

12 months ago

2.7.62

12 months ago

2.7.61

12 months ago

2.7.60

12 months ago

2.7.59

12 months ago

2.7.58

12 months ago

2.7.57

12 months ago

2.7.56

12 months ago

2.6.56

12 months ago

2.6.55

12 months ago

2.6.54

12 months ago

2.6.53

12 months ago

2.6.52

12 months ago

2.5.52

12 months ago

2.5.51

1 year ago

2.5.50

1 year ago

2.5.49

1 year ago

2.5.48

1 year ago

2.4.48

1 year ago

2.3.48

1 year ago

2.3.47

1 year ago

2.3.46

1 year ago

2.3.45

1 year ago

2.3.44

1 year ago

2.2.44

1 year ago

2.2.43

1 year ago

2.2.42

1 year ago

2.2.41

1 year ago

2.2.40

1 year ago

2.1.40

1 year ago

2.1.39

1 year ago

2.1.38

1 year ago

2.1.37

1 year ago

2.1.36

1 year ago

2.1.35

1 year ago

2.1.34

1 year ago

2.1.33

1 year ago

2.1.32

1 year ago

2.1.31

1 year ago

2.1.30

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

1.1.14

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

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