Aller au contenu

Référence des Modules

internal:array Natif et WASM

Section intitulée « internal:array »

Utilitaires pour manipuler, interroger et transformer des tableaux.

  • arr.len(array)
  • arr.push(array, items...)
  • arr.pop(array)
  • arr.first(array)
  • arr.last(array)
  • arr.reverse(array)
  • arr.join(array, separator)
  • arr.contains(array, value)
  • arr.sum(array)
  • arr.avg(array)

Operations de système de fichiers: lecture, écriture, liste et déplacement de chemins.

  • fs.cwd()
  • fs.chdir(path)
  • fs.exists(path)
  • fs.read_file(path)
  • fs.write_file(path, content)
  • fs.append_file(path, content)
  • fs.list_dir(path?)
  • fs.mkdir(path)
  • fs.remove(path)
  • fs.rename(from, to)
  • fs.copy(from, to)

internal:hash Natif et WASM

Section intitulée « internal:hash »

Aides de hachage et d’encodage: SHA-256, HMAC, hex et base64.

  • hash.sha256(input)
  • hash.hmac_sha256(key, message)
  • hash.base64_encode(input)
  • hash.base64_decode(input)
  • hash.hex_encode(input)
  • hash.hex_decode(input)

Aides client HTTP pour les requêtes et l’inspection des réponses.

  • http.get(url, timeout_ms?)
  • http.delete(url, timeout_ms?)
  • http.post(url, body, content_type?, timeout_ms?)
  • http.put(url, body, content_type?, timeout_ms?)
  • http.patch(url, body, content_type?, timeout_ms?)
  • http.request(method, url, body?, content_type?, timeout_ms?)
  • http.status(response)
  • http.ok(response)
  • http.text(response)
  • http.body(response)

internal:math Natif et WASM

Section intitulée « internal:math »

Constantes mathématiques et opérations numériques pour les calculs.

  • math.pi()
  • math.e()
  • math.tau()
  • math.abs(n)
  • math.sqrt(n)
  • math.cbrt(n)
  • math.pow(base, exp)
  • math.min(...)
  • math.max(...)
  • math.floor(n)
  • math.ceil(n)
  • math.round(n)
  • math.trunc(n)
  • math.sin(n)
  • math.cos(n)
  • math.tan(n)
  • math.asin(n)
  • math.acos(n)
  • math.atan(n)
  • math.atan2(y, x)
  • math.sinh(n)
  • math.cosh(n)
  • math.tanh(n)
  • math.exp(n)
  • math.ln(n)
  • math.log(n, base)
  • math.log10(n)
  • math.log2(n)
  • math.random()
  • math.eval(value)

internal:random Natif et WASM

Section intitulée « internal:random »

Generation de valeurs pseudo-aleatoires avec graine deterministe optionnelle.

  • random.float()
  • random.bool()
  • random.seed(seed)
  • random.int(min, max)
  • random.choice(array)
  • random.shuffle(array)

Utilitaires légers de serveur HTTP pour le routage local et les réponses.

  • new Server()
  • server.defineRoute(path, handlerFn)
  • server.defineRoutes(path, handlerFn)
  • server.listen(port)
  • server.serve(port)
  • server.wait()
  • server.stop()
  • server.stop_all()
  • server.running()
  • server.address()
  • server.url()
  • server.start(port, body?, status?, content_type?)

Assistants de connexion dans les gestionnaires :

  • connection.reply(body)
  • connection.status(code)
  • connection.contentType(type)

internal:string Natif et WASM

Section intitulée « internal:string »

Aides de manipulation de chaînes de caractères pour le changement de cas, le découpage, la correspondance et le remplacement.

  • str.len(s)
  • str.upper(s)
  • str.lower(s)
  • str.trim(s)
  • str.split(s, delimiter)
  • str.replace(s, from, to)
  • str.contains(s, needle)
  • str.starts_with(s, prefix)
  • str.ends_with(s, suffix)
  • str.repeat(s, n)
  • str.reverse(s)
  • str.chars(s)

internal:system Natif et WASM

Section intitulée « internal:system »

Informations runtime et environnement: temps, arguments et plateforme.

  • sys.time()
  • sys.time_ms()
  • sys.args()
  • sys.env(key)
  • sys.platform()
  • sys.arch()

internal:uuid Natif et WASM

Section intitulée « internal:uuid »

Aides de génération d’UUID pour les versions 1, 4, 6 et 7.

  • uuid.v1()
  • uuid.v4()
  • uuid.v6()
  • uuid.v7()