Popularity
5.6
Growing
Activity
0.0
Stable
25
2
4
Programming language: Crystal
License: MIT License
Tags:
Networking
bson.cr alternatives and similar shards
Based on the "Networking" category.
Alternatively, view bson.cr alternatives based on common mentions on social networks and blogs.
-
msgpack-crystal
MessagePack implementation in Crystal msgpack.org[Crystal] -
ipaddress.cr
A Crystal library to handle IPv4 and IPv6 addresses in a modern and productive way. -
transfer_more
Fast and temporary file uploader :signal_strength: UPSTREAM ON https://git.sceptique.eu/Sceptique/transfer_more
Static code analysis for 29 languages.
Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Promo
www.sonarqube.org
Do you think we are missing an alternative of bson.cr or a related project?
Popular Comparisons
README
BSON
BSON implemented in Crystal according to the spec.
Installation
Add this line to your application's shard.yml
:
dependencies:
bson:
github: jeromegn/bson.cr
Usage
require "bson"
io = File.open(File.expand_path("examples/sample.bson")) # A pretty representative BSON document
BSON.decode(io) # => Returns a Hash instance
bson, writer = IO.pipe
"a string".to_bson(writer) # => encodes the string to BSON and writes to the IO
puts String.from_bson(bson).inspect # => "a string"
doc = Hash{
"name" => "hello",
"int" => 32
}
puts doc # => { "name" => "hello", "int" => 32 }
bson, writer = IO.pipe
doc.to_bson(writer) # => Encodes the whole document to BSON and writes to the IO
puts BSON.decode(bson) # => { "name" => "hello", "int" => 32 }
Supported types
All types specified in the BSON spec.
Relevant basic types of Crystal have been extended to add #to_bson(io : IO)
and .from_bson(io : IO)
for simplicity.
A BSON::Document
is just an alias for Hash(String, BSON::Type)
TODOs
- [ ] More tests
Caveats
- Only supported Regex options are the ones also supported by Crystal:
i
andm
basically.
Contributing
- Fork it ( https://github.com/jeromegn/bson.cr/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
- jeromegn Jerome Gravel-Niquet - creator, maintainer