From e058a29d70dd299b7fc2a84cae5824fd03fbef84 Mon Sep 17 00:00:00 2001 From: ame Date: Tue, 17 Jun 2025 00:25:14 -0500 Subject: more docs --- docs/readme.md | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'docs/readme.md') diff --git a/docs/readme.md b/docs/readme.md index 26fc5cb..9436ba0 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -1,16 +1,16 @@ -# lullaby (llib) +# lullaby (llby) (name subject to change) with the library in the same directory [(or one of the other valid search locations)](https://www.lua.org/pil/8.1.html) ```lua -llib = require "lullaby" +llby = require "lullaby" ``` returns a table has many subtables and functions, with related function in them, you can view them like so ```lua -llib.io.pprint(llib) --pprint is a part of the io module, pprint meaning pretty print +llby.io.pprint(llby) --pprint is a part of the io module, pprint meaning pretty print ``` all subtables and functions have a corresponding file in this directory on usage @@ -22,6 +22,33 @@ crypto = require "lullaby.crypto" crypto.sha224() ``` +### configuration + +modules will each have different values you can change + +each individual function will list what values you can modify, but all of them will exist in the parent table + +```lua +llby.net.mimetypes = "/etc/meow" +``` + +## common functions/utils + +### stream + +streams allow generating a string in smaller chunks to save on memory + +currently can only be made in c using luaI_newstream + +stream:file(filename, bytes?) +stream:read(bytes?) + +both function identically, file sending the data to a file and read returning it + +the number of bytes can be selected, the function will return an amount close to what was requested + +some streams may not support the bytes param, and may just ignore it. if it is ignored or not given it will always read the entire stream + --- ## big changes -- cgit v1.2.3