No description
Find a file
xmonader d06724dd7b
Merge pull request #13 from Patitotective/patch-1
Added support to bundle independent files
2022-05-01 23:18:41 +02:00
examples Stop using deprecated API:s, add LICENSE, add tests, formatting and more 2021-07-20 19:38:21 +02:00
src Added support to bundle independent files 2022-05-01 15:19:57 -05:00
tests Fixed tests, made Windows system branch 2021-11-10 14:04:14 -05:00
.gitignore Remove Trailing Whitespace + Fast Testcase 2021-07-28 13:46:23 +02:00
CHANGELOG.md Typo 2022-02-08 18:12:26 +01:00
LICENSE Stop using deprecated API:s, add LICENSE, add tests, formatting and more 2021-07-20 19:38:21 +02:00
nim.cfg Stop using deprecated API:s, add LICENSE, add tests, formatting and more 2021-07-20 19:38:21 +02:00
nimassets.nimble Update nimassets.nimble 2022-05-01 15:24:07 -05:00
README.md Add binary/zstd encoding method. 2021-12-04 17:08:30 +08:00

nimassets

nimassets Nim Assets is heavily inspired by go-bindata to bundle all of your assets into one single nim file.

Usage

nimassets 0.2.2 (Bundle your assets into nim file)
    -h  | --help          : show help
    -v  | --version       : show version
    -o  | --output        : output filename
    -f  | --fast          : faster generation
    -d  | --dir           : dir to include (recursively) [can be used multiple times -d=DIR1 -d=DIR2 ...]
    -t  | --type          : binary | base64 | zstd | base64zstd
    -cl | --compresslevel : compress level for zstd, default is 3

Bundle

To bundle all the files in directory templatesdir from the examples folder into single nim file assetsfile.nim

cd examples
nimassets -d=templatesdir -o=assetsfile.nim

-f or --fast flag can help with large assets directories -t or --type encoding method, default is base64

Use Assets

import assetsfile # name from -o=<filename>

echo assetsfile.getAsset("templatesdir/index.html")

Development

To run tests, simply do nimble test from the root of this repository.

To compile the distributable binary, run nimble assetsBin. It will be built and available in ./build/nimassets.