Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xmonader/nimassets
bundle your assets into single nim file inspired by go-bindata
https://github.com/xmonader/nimassets
assets assets-management bundle go-bindata nim
Last synced: 21 days ago
JSON representation
bundle your assets into single nim file inspired by go-bindata
- Host: GitHub
- URL: https://github.com/xmonader/nimassets
- Owner: xmonader
- License: mit
- Created: 2018-12-13T05:11:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-05-01T21:18:41.000Z (over 2 years ago)
- Last Synced: 2024-08-05T17:31:56.108Z (4 months ago)
- Topics: assets, assets-management, bundle, go-bindata, nim
- Language: Nim
- Size: 30.3 KB
- Stars: 58
- Watchers: 6
- Forks: 7
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-hacking-lists - xmonader/nimassets - bundle your assets into single nim file inspired by go-bindata (Nim)
README
# nimassets
nimassets `Nim Assets` is heavily inspired by [go-bindata](https://github.com/jteeuwen/go-bindata) to bundle all of your assets into one single nim file.
## Usage
```bash
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`
```bash
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=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`.