1.0.49 • Published 6 months ago
@kamen/create-webapp v1.0.49
@kamen/create-webapp

Project Scaffolding (wip)
$ npm init @kamen/webappUtility Functions
Basic example
import {
createRandomFromRange,
createRandomFromList,
createRandomColorFromSaturationLightnessAlpha
} from '@kamen/create-webapp';
const characters = Array
.from({length: 26}, (_, index) => [
String.fromCharCode(65 + index),
String.fromCharCode(97 + index)
])
.flat();
const ageHandler = createRandomFromRange(0, 99);
const colorHandler = createRandomFromList(['red', 'green', 'blue']);
const stateHandler = createRandomFromList([true, false]);
const identHandler = createRandomFromList(characters);
const identFormatHandler = () => Array
.from({length: 1 << 5}, identHandler)
.join('');
const data = Array
.from({length: 1 << 8}, (_, index) => ({
index,
age: ageHandler(),
color: colorHandler(),
state: stateHandler(),
ident: identFormatHandler()
}));
console.dir(data);Dynamic import from CDN
const {
createRandomFromList
} = await import('https://esm.run/@kamen/create-webapp');
function createAlphabet() {
const baseChar = 'a';
const lowerCode = baseChar.charCodeAt();
const upperCode = baseChar.toUpperCase().charCodeAt();
const length = 'z'.charCodeAt() - lowerCode + 1;
return Array
.from({length}, (_, index) => [
String.fromCharCode(lowerCode + index),
String.fromCharCode(upperCode + index)
])
.flat();
}
const identHandler = createRandomFromList(createAlphabet());
const identFormatHandler = () => Array
.from({length: 1 << 5}, identHandler)
.join('');
console.log(identFormatHandler());Advanced example
1.0.26
1 year ago
1.0.29
1 year ago
1.0.28
1 year ago
1.0.27
1 year ago
1.0.33
1 year ago
1.0.32
1 year ago
1.0.31
1 year ago
1.0.30
1 year ago
1.0.37
1 year ago
1.0.36
1 year ago
1.0.35
1 year ago
1.0.34
1 year ago
1.0.39
9 months ago
1.0.38
1 year ago
1.0.40
9 months ago
1.0.44
8 months ago
1.0.43
8 months ago
1.0.42
8 months ago
1.0.41
9 months ago
1.0.48
6 months ago
1.0.47
6 months ago
1.0.46
6 months ago
1.0.45
7 months ago
1.0.49
6 months ago
1.0.25
1 year ago
1.0.24
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
1.0.22
1 year ago
1.0.21
1 year ago
1.0.20
1 year ago
1.0.15
1 year ago
1.0.23
1 year ago
1.0.14
1 year ago
1.0.12
1 year ago
1.0.9
2 years ago
1.0.11
2 years ago
1.0.10
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago