Skip to content

bundle your assets into single nim file inspired by go-bindata

License

Notifications You must be signed in to change notification settings

xmonader/nimassets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

d06724d · May 1, 2022

History

19 Commits
Jul 20, 2021
May 1, 2022
Nov 10, 2021
Jul 28, 2021
Feb 8, 2022
Jul 20, 2021
Dec 4, 2021
Jul 20, 2021
May 1, 2022

Repository files navigation

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.

About

bundle your assets into single nim file inspired by go-bindata

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages