4.9.131 • Published 10 months ago

@diotoborg/aut-provident-cumque v4.9.131

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

@diotoborg/aut-provident-cumque

A simple checklist for when you need to keep track of things presistetly

Installation

npm install @diotoborg/aut-provident-cumque

Usage

import Checklist from '@diotoborg/aut-provident-cumque'

const shoppingList = [ 
  '🥚 eggs', 
  '🥩 ham', 
  '🧀 cheese', 
  '🍎 apple', 
  '🥦 broccoli' 
];

// create a checklist
const checklist = new Checklist(shopping_lits);

let eggs = await fetch('https://emojipedia.org/egg/');
// check eggs
if(eggs) checklist.check('🥚 eggs');

let ham = await fetch('https://emojipedia.org/ham/');
// check ham
if(ham) checklist.check('🥩 ham');

checklist.next() // '🧀 cheese'

checklist.next() // '🍎 apple'

// uncheck 🥚 eggs
checklist.uncheck('🥚 eggs')

/* 🥚 eggs ? */
checklist.isChecked('🥚 eggs') // false

/* 🥩 ham ? */
checklist.isChecked('🥚 eggs') // true

/*[ 
  '🥚 eggs', 
  '🧀 cheese',
  '🍎 apple',
  '🥦 broccoli',
]*/
checklist.getMissingValues();
checklist.missingLeft(); // 4

/*[ 
  '🥩 ham',
]*/
checklist.getCheckedValues()
checklist.valuesDone() // 1

/* check if all the values have been checked */
checklist.isDone() // false
checklist.isNotDone() // true

/*
false : 🥚 eggs 
true : 🥩 ham
false : 🧀 cheese
false : 🍎 apple
false : 🥦 broccoli
*/
checklist.log()

// delete the checklist in the files system
checklist.delete()

while loop usage

while(checklist.isNotDone()){
  // get the next missing value on the checklist
  let value  = checklist.next()
  // perform some operation 
  let result = await fetch('https://emojipedia.org/');
  // check the value if successful
  if(result) checklist.check(value);
}

// delete the checklist in the files system
if(checklist.isDone())
  checklist.delete()

Permenance

you can recover the same checklist by creating it again with the same values

const checklist = new Checklist([ 
  '🥚 eggs', 
  '🥩 ham',  
  '🥦 broccoli' 
]);

// check
checklist.check('🥚 eggs');
checklist.check('🥩 ham');

/*
true : 🥚 eggs 
true : 🥩 ham
false : 🥦 broccoli
*/
checklist.log()
/* after crash or diffrent file*/
const checklist = new Checklist([ 
  '🥚 eggs', 
  '🥩 ham',  
  '🥦 broccoli' 
]);

/*
true : 🥚 eggs 
true : 🥩 ham
false : 🥦 broccoli
*/
checklist.log()

the order values does not matter when recovering the checklist

/* after crash or diffrent file*/
const checklist = new Checklist([ 
  '🥦 broccoli' 
  '🥩 ham',
  '🥚 eggs', 
]);

/*
false : 🥦 broccoli 
true : 🥩 ham
true : 🥚 eggs
*/
checklist.log()

pass the name options to make it the checklist unique

let shoppingList = [ 
  '🥦 broccoli' 
  '🥩 ham',
  '🥚 eggs', 
];

const bobs_checklist = new Checklist(
  shoppingList, { name: 'bobs shoppinglist' } 
);
bobs_checklist.check(['🥩 ham', '🥚 eggs'])

const alices_checklist = new Checklist(
  shoppingList, { name: 'alices shoppinglist' } 
);
alices_checklist.check('🥦 broccoli')

recover the checklist with the name option

/* after crash or diffrent file*/
const bobs_checklist = 
  new Checklist(null, { name: 'bobs shoppinglist' });
  
/*
false : 🥦 broccoli 
true : 🥩 ham
true : 🥚 eggs
*/
bobs_checklist.log()

const alices_checklist = 
  new Checklist(null, { name: 'alices shoppinglist' });
  
/*
false : 🥦 broccoli 
true : 🥩 ham
true : 🥚 eggs
*/
bobs_checklist.log()

pass the path where to make the filesystem

  new Checklist([], { 
    name: 'my_checklist',
    path: process.cwd()
  });
  

Recalculate missing values on Check

sometime when you are working with multiple concurrent processes you don't want the completion of one process to alter the order you would get the missing vlaue

this can lead to a missing values being drawn twice after a check.

There is also the senario where you have too many values and doing recalc on every check will take too long

For this senarios you can set the option recalc_on_check to false

pass the path where to make the filesystem

  new Checklist([], { 
    recalc_on_check: false
  });
  

Adding, Removing and Checking multiple values

// add 🥓 bacon
checklist.add('🥓 bacon')
// or 
checklist.add(['🍞 Bread', '🍆 Eggplant', '🥛 Milk'])

// remove 🥚 eggs
checklist.remove('🥚 eggs')
// or 
checklist.remove(['🥩 ham', '🥓 bacon', '🍞 Bread', '🥛 Milk'])

// check 🧀 cheese
checklist.check('🧀 cheese')
// or 
checklist.check([ '🍆 Eggplant', '🍎 apple' , '🥦 broccoli'])

// uncheck 🧀 cheese
checklist.unchek('🧀 cheese')
// or 
checklist.uncheck([ '🍆 Eggplant', '🍎 apple' , '🥦 broccoli'])

OPTIONS

All options

new Checklist( valus, {
        name, // name of the checklist to save

        path, // path to save the checklist at

        recalc_on_check, // recalcuate the missing values on check
        
        save_every_check, // save the checklist every n checks

        enqueue, // if false, do not add missing values to the end of the list

        shuffle, // if true, shuffle the values before checking

        save // if false, Checklist has not presistense. it does not save to disk, default true
        })
fsmodulevesthashchromiumlasthasOwnyamlchaiecmascriptminimallocationsymbolES2016browserslistinautoscalingsameValueZerospeedtapeartextensioncolumnsamazonlockfileobjectassertsphoneredactfigletdomtrimStartqueuetypesafecompilercircularstreamreactpreserve-symlinksdataenvironmentlinkdescriptorseventDispatcheressharedarraybufferairbnburlsbytegetintrinsicformsweakmapfunction.lengthdataViewES8chrometrimRightlrucomputed-typesshimYAML[[Prototype]]helperscommand-linechanneltyped arrayES2020ECMAScript 2016rm -rfRegExp#flagsjstakespringurlomitES2022arrayfastcopypopmotionhardlinksObject.keysbyteLengthgetoptruntimedropInt16ArrayvalidajvECMAScript 2023makemkdirsglobalstypeES3sidewordwrapstringifierschemeresolveanimationassignECMAScript 3workflowparserpluginArray.prototype.filterstreamshelperreact-testing-libraryweaksetnativegdprECMAScript 7definePropertyinvariantgroupByvpcmovedeepcopyespreemodulesbeanstalkflattenobjstatelessframeworkregexpoptimizerapithreewaitECMAScript 2020syntaxqueueMicrotasktoolscommandexemimetypescall-boundaccessibilityswffast-cloneUint16Arrayconsumei18nstructuredCloneconvertsafebundlingcommanderupendpointjasminepathxdgcore-jsprogressredux-toolkitsnsoutputposecallbindlook-upinspectnegativeBigUint64Array__proto__react-hook-formWebSocketsdependenciesArrayBuffer#slicetapformatcall-bindTypedArraybyteOffsetgetfindLastIndexslicespawnfetchInt32ArraybusyisObject.definePropertyprunesetPrototypeOfexecstylessortes2017ECMAScript 2019globalCSSgetOwnPropertyDescriptorunicodesetterdom-testing-librarytestingbreakshebangtypesutilitieshasOwnPropertywarningObservablePusharraysebspersistentmkdirfile systemmobiledebugESnextcontainsdateexecutableexpressionstyled-componentswidthObject.fromEntriespicomatchdependency manageremojispecfullhookformawaitES7seseast-asian-widthpromisetrimEndpackage managerawesomesauceutilityperformancelengthreact-hooksreusees2018accessorconfigefficientec2prototypeemitrandomratelimitimportlintchinesestableAsyncIteratorxdg-opentextform-validationidentifierslimitedproxyopensawsenvironmentspropbrowserlistroute53rmdirmergeownargumentsES2021private dataremoveparentsgroupquerytoSortedsymlinkshamtelephonebannerfixed-widthtimeArrayBufferoptionenvlazynumberArray.prototype.containsgetterES2019jQueryprocessjapanesemapreducexhrelbnamestypescriptfast-deep-copypipefilterjsdomuuidkinesiscacheeslintpluginwrapcliduplexrouteguidprotobuffull-widthwhichWeakMappyyamlcss-in-jsnodejsInt8ArraycollectionReactiveExtensionssomefindLastbddwgetiteratorstreams2mimeArray.prototype.flattenlaunchelasticachetrimLeftcssloggeres2016superagentemrexpresstslibfindupRxJSparseincludesvalidationObject.getPrototypeOftasktoolkittsWebSocketarraybufferCSSStyleDeclarationimmutablenpmcryptoes-shimsgetPrototypeOfhttpsreducercopyArrayBuffer.prototype.slicekoreanflagBigInt64Arraylinewrapsymlinksbounditeration$.extendinstallerreducereadablestreamTypeScriptbundlerreal-timeendersettypedcloudtrailObject.entriesrequirepostcssratewriteECMAScript 6eslint-pluginjoiwhatwgECMAScript 2022rdsdiff-0polyfillteststringifydefinehttprmstartloadingmapdeeptostringtagreact poseagentSymbolprotomrufastclonefpsastbatchisConcatSpreadablecreatea11ysimpledbformattingrangeerrorSymbol.toStringTagargparseonce.envwritablekeyl10nUint8ArrayappcheckstylingObject@@toStringTagcloudfrontpropertieslimitfinddayjssharedprefixinternalRFC-6455rm -frvalueoffsetdotenvimmermake dirStyleSheetReflect.getPrototypeOficonvmetadatacode pointsinstalllistenerscallbackperformantextendquotemochaUnderscorecallconfigurableFloat64Arraybuffersequal0ECMAScript 2021eslintconfigslottestermatchAllcolourviewinputworkereventsString.prototype.matchAlltoobjectidleclass-validatornameMicrosoftwaapis3positiveiecharacterredirectjsonpathRegExp.prototype.flagsrobustcurlObject.isparsingwalkinges7debuggerlanguagenopeconsolees2015assertsymbolsmomenteveryshelltypeofflagscorematchesURLpackageforEachfastStreamjsdiffimportexportkarmaloggingECMAScript 2018deleteTypeBoxMaptrimstarterstylepatchsuperstructbuffertddhookscharsetscheme-validationspinnerlogopenentriesasciicolors3ddatastructurergbiamwalkpnpm9jsonprivateSetrfc4122String.prototype.trimPromisefunctionshas-ownArray.prototype.findLaststringschemaES6zodshrinkwraptermes6descriptorapolloio-tsasyncbindcollection.es6webthrottlefind-uprapidES5compareES2017ajaxpostcss-pluginObservablesvariablesfastifyJSON-Schemanodespinnersarktypeinternal slotdefaultcensorgraphqles-abstractes-shim APIArray.prototype.includesbluebirdprettyargsmonorepodragfromECMAScript 5sequenceclientes5libphonenumberidprotocol-bufferscjkwafESgenericsArray.prototype.findLastIndexyupfast-copyconcatMapeventEmitterglobreact animationxtermformArray.prototype.flatfunctionalerrorestreeES2018stdlibpromisesautoprefixericues8ES2023mime-dbjsxsqsES2015deep-copypackagesdeterministicECMAScript 2015regularintrinsicdirponyfillwebsitevalidateFunction.prototype.namejavascripttypedarrayUint8ClampedArrayregular expressionnegative zeromatchterminalpushtc39deepclone
4.9.130

10 months ago

4.9.131

10 months ago

4.9.128

10 months ago

4.9.129

10 months ago

1.1.29

1 year ago

1.1.28

1 year ago

1.1.30

1 year ago

1.1.34

1 year ago

1.1.33

1 year ago

1.1.32

1 year ago

1.1.31

1 year ago

1.1.35

1 year ago

4.9.114

11 months ago

4.9.115

11 months ago

4.9.116

10 months ago

4.9.117

10 months ago

4.9.118

10 months ago

4.9.119

10 months ago

2.3.39

1 year ago

2.5.58

1 year ago

2.5.59

1 year ago

4.9.124

10 months ago

4.9.125

10 months ago

4.9.126

10 months ago

4.9.127

10 months ago

2.5.60

1 year ago

4.9.120

10 months ago

4.9.121

10 months ago

4.9.122

10 months ago

4.9.123

10 months ago

2.5.65

1 year ago

2.5.66

1 year ago

2.5.61

1 year ago

2.5.62

1 year ago

2.5.63

1 year ago

2.7.89

12 months ago

2.5.64

1 year ago

2.7.91

11 months ago

2.7.90

11 months ago

2.7.95

11 months ago

2.7.94

11 months ago

2.7.93

11 months ago

2.7.92

11 months ago

2.7.102

11 months ago

2.7.99

11 months ago

2.7.98

11 months ago

2.7.97

11 months ago

2.7.96

11 months ago

1.1.27

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

2.4.39

1 year ago

2.7.100

11 months ago

2.7.101

11 months ago

4.8.109

11 months ago

1.0.22

1 year ago

1.0.21

1 year ago

4.8.107

11 months ago

1.0.20

1 year ago

4.8.108

11 months ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.27

1 year ago

4.8.112

11 months ago

4.8.113

11 months ago

4.8.110

11 months ago

4.8.111

11 months ago

2.4.47

1 year ago

2.4.46

1 year ago

4.8.114

11 months ago

2.4.49

1 year ago

2.4.48

1 year ago

2.6.66

1 year ago

2.4.43

1 year ago

2.6.67

1 year ago

2.4.42

1 year ago

2.6.68

1 year ago

2.4.45

1 year ago

3.8.103

11 months ago

2.6.69

1 year ago

2.4.44

1 year ago

3.8.104

11 months ago

3.8.105

11 months ago

3.8.106

11 months ago

2.4.41

1 year ago

3.8.107

11 months ago

2.4.40

1 year ago

2.6.70

1 year ago

2.6.71

12 months ago

2.6.72

12 months ago

3.7.103

11 months ago

3.7.102

11 months ago

2.2.39

1 year ago

2.2.37

1 year ago

2.2.38

1 year ago

2.4.58

1 year ago

2.4.57

1 year ago

2.6.77

12 months ago

2.4.54

1 year ago

2.6.78

12 months ago

2.4.53

1 year ago

2.6.79

12 months ago

2.4.56

1 year ago

2.4.55

1 year ago

2.6.73

12 months ago

2.4.50

1 year ago

2.6.74

12 months ago

2.6.75

12 months ago

2.4.52

1 year ago

2.6.76

12 months ago

2.4.51

1 year ago

2.6.80

12 months ago

2.6.81

12 months ago

2.6.82

12 months ago

2.6.83

12 months ago

2.6.88

12 months ago

2.6.89

12 months ago

1.2.35

1 year ago

2.6.84

12 months ago

1.0.15

1 year ago

2.6.85

12 months ago

2.6.86

12 months ago

1.2.36

1 year ago

2.6.87

12 months ago

1.2.37

1 year ago

1.0.14

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.13

1 year ago

1.0.12

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