Popularity
6.6
Growing
Activity
2.0
-
44
3
1
Programming language: Crystal
License: MIT License
Tags:
Template Engine
Latest version: v0.3.0
Jbuilder alternatives and similar shards
Based on the "Template Engine" category.
Alternatively, view Jbuilder alternatives based on common mentions on social networks and blogs.
-
ECR (Embedded Crystal)
compile time template language which uses plain crystal expressions (Crystal stdlib)
InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
Promo
www.influxdata.com

Do you think we are missing an alternative of Jbuilder or a related project?
README
Jbuilder
Generate JSON objects with a Builder-style DSL, inspired by jbuilder (https://github.com/rails/jbuilder)
Installation
- Add the dependency to your
shard.yml
:
dependencies:
jbuilder:
github: shootingfly/jbuilder
- Run
shards install
Usage
require "jbuilder"
First, write down the code.
Jbuilder.new do |json|
json.null nil
json.code 200
json.msg "ok"
json.merge!({"code" => 201})
json.array! "array1", [1, 1.0, "1"]
json.array!("array2", [1, 2, 3, 4]) do |json, item|
json.code item
end
json.data do |json|
json.code 400
json.array! "array3", [1, 1.0, "1"]
end
json.set!("custom_field", %w[1 2])
end.to_json
Then you can see,
{
"null":null,
"code":201,
"msg":"ok",
"array1":[
1,
1.0,
"1"
],
"array2":[
{
"code":1
},
{
"code":2
},
{
"code":3
},
{
"code":4
}
],
"data":{
"code":400,
"array3":[
1,
1.0,
"1"
]
},
"custom_field":[
"1",
"2"
]
}
An example using Kemal
https://github.com/shootingfly/kemal-jbuilder-example
Changelog
- v0.3.0
- Support Tuple and Named Tuple
- Support render with layout and child template
- v0.2.0
- Support Kilt
- v0.1.0
- First Release
Contributing
- Fork it (https://github.com/shootingfly/jbuilder/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Shooting Fly - creator and maintainer