1.1.9 • Published 1 year ago

@juigorg/at-debitis v1.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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 @juigorg/at-debitis

Usage

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

const @juigorg/at-debitis = require('@juigorg/at-debitis');

New() is the main class, create a new instance of this! The instance of @juigorg/at-debitis 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 @juigorg/at-debitis = require('@juigorg/at-debitis');
var registry = new @juigorg/at-debitis.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 @juigorg/at-debitis 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 @juigorg/at-debitis = require('@juigorg/at-debitis');
var registry = new @juigorg/at-debitis.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 @juigorg/at-debitis = require('@juigorg/at-debitis');
var registry = new @juigorg/at-debitis.New(null, true);

Custom splitter

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

// custom splitter
const @juigorg/at-debitis = require('@juigorg/at-debitis');
var registry = new @juigorg/at-debitis.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.

loggerextrabrowserslistsymbolexecfiletesterpromiseexecxmlfastcloneargvtrimtapeeslintconfigchromecodeskeymergeselfmoduletrimLeftgroupBynamefast-deep-clonerulesfindLastIndexcall-bindtoArraydeterministicclientenvironmenttoobjectminimalserializerredactmochastringifiertddmakerapidspringcurldirectoryfullArray.prototype.filterdataViewdirRFC-6455react-hooksReflect.getPrototypeOfECMAScript 2015arktypeArray.prototype.containsflatteninstrumentationclassnamejavascriptrm -rfnegative zerocolumnsutil.inspectconfigurablereversedES2017fast-copypropertiescolorhookformSymbol.toStringTagfilterrdshassymlinksvalidatecoreInt8Arrayjestparentruntime.gitignoreinputarraystoolkitcloudformationtermietc39styleguideECMAScripttypedarrayterminalrmdirtypedarraysvalidationreducerfigletexpressincludestyped arrayescapefixed-widthreducedataviewloadingArray.prototype.findLastdomurlsortwgetreusetypescsspackage managernumberes2015httpscallapistringsuperstructUint16Arrayjson-schema-validatortslibjapanesevpcclonenpmsyntaxObservablesymbolszodrobustimmutableyamlremovewaitquoteconsolePromisees-abstractinStreames7textramdalook-uphttpcallbackhardlinksprefixspeedspawn0loggingclassnamesunicodephonedeep-copycall-boundequalfunctionparserebsl10nwalkingObject.fromEntriescloudwatchbddReactiveExtensionsnamesjsdiffpostcss-pluginRegExp#flagscode pointssetPrototypeOfansiAsyncIteratorcharacterdom-testing-librarylistenerscryptoglobalsECMAScript 3formspreprocessorES2019emitjoischemecommandjscommand-linechromiumReactiveXhigher-orderlockfilesidedescriptionswfimportexportECMAScript 2018zxcjkchannelCSSStyleDeclarationsharedarraybuffertypedreadablesinatraRxJSmulti-packagestringifyString.prototype.trimasciigenericsxhrautoscalingES5commanderArray.prototype.includesforEachBigUint64ArrayObject.isESnextdebugespreereact-hook-formhashwhichframework-0popmotionStreamsregexpqsautoprefixergraphqlfunctionalresolveec2ECMAScript 2017validatorawsES2015ECMAScript 5intrinsicsetwriteclassesroutekarmapoint-freeglobalESinstallerconstInt16ArrayacornUint8ClampedArrayviewroutingparseWeakMapfastifysearchequalityglobprotocol-buffersawesomesaucesimpledbstreamPushfull-widthlookUnderscore$.extendbyteOffsetfpseventDispatchererroremrutilsdiffpluginavareadfolderttymkdiroutputeventEmitterHyBicopylruformcircularapphelpercollectionvisualprettyhas-owntypescriptmomentdefineglaciershamfast-deep-copysafejsxes8optiontranspileratomArray.prototype.flatdeep-cloneECMAScript 2020TypeScriptflagspackage.jsondependencieseslintpluginfunction.lengthamazontsdropcurriedtoSortedsometoolstransformURLchaivarsstyled-componentsoptimizerreacttoStringTagdeleteWeakSetvariablestransportmapeast-asian-widthidrestregular expressionenvStyleSheetgetOwnPropertyDescriptorprotobufRegExp.prototype.flagsECMAScript 2019utilityinferencenodejshintutilitieshasOwnPropertyassertObject.getPrototypeOfstyle__proto__starterSetdefinePropertyinspectparentselasticachesqscomputed-typesdebuggerlocalyupbusypushcoveragedescriptortapchineseObject.entriesqueryjson-schemajsonschemagetintrinsicfantasy-landlinkObjectboundassertsgetoptbundlerredux-toolkitisglobal objectproxyajaxsetterwhatwgflatMapArray.prototype.flatMapfile systemreadablestreamglobal this valuedotenvArrayBufferutilUint32Arrayreduxstreamsestypaniondayjs[[Prototype]]rsspatchTypedArraytrimStart3doncelogreversedatainstalleslint-plugingroupweakmapidlespecassertionelectronnopenodejsES2018mobileglobalThispositiveimmersetImmediateMicrosoftsource maprequestdeepclonematchesfpisConcatSpreadableeveryformatshebangkinesispathpurefast-cloneloadbalancinguninstallpostcsscensorfstelephonefnmatchenvironmentsiamRxprocesstouchfastcopycompilerdragsameValueZerotypeerrorcloudfrontrmmkdirsprivatetrimRighttestingpyyamlargses2016containsinternal slotperformantaccessorharmonyjasmineletqueuewafvalueairbnbregularsliceconcatMapgetinternalflagtypeof_.extendserialize256feedbinupfileJSONbannerpackagesreworkUint8ArraymovefindLastwritablecloudtrailobjectexpressionmatchAllbyteLengthdynamodbrfc4122walksharedWebSocketsspinneroptimistprotoES8form-validationfullwidth6to5react poseanimationcheckObject.keysenderlanguagearraymonoreposlotkeysentriespropstylestrimEndcallboundsnswaapijQuerya11ybundlingprototypechildcliarraybufferreact-testing-libraryIteratorrm -frframerstableindicatorvaluesbindpnpm9findpackageschemaURLSearchParamsendpointFloat64ArrayYAMLiteratorgesturesfromapolloES2016modulesprivate datavalidajvlintuuidwarningecmascriptinvariantlengthjson-schema-validationshelltypelocationeslintidentifiershasOwnconcatmatches5emojiignoredatedescriptorsES2023Array.prototype.flattenECMAScript 6progressvestArrayBuffer.prototype.slicemrurandomimportfind-upes-shimsES2021make diroffsethtmlastArray.prototype.findLastIndexgitignoreECMAScript 2021jsdomcachefetchpicomatchforkpolyfillcreatecharactersshimworkspace:*ponyfillartcolorsregular-expressionBigInt64Arraygdprserializationperformancetranspile.envtimestoragegatewayroutertestformattingSymbolbufferECMAScript 7xtermaccessibilityMap@@toStringTages-shim APIzerometadataCSS
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.1.4

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