Skip to content

Commit

Permalink
📚 docs: update README.md #4
Browse files Browse the repository at this point in the history
  • Loading branch information
pnguyen215 committed Jan 15, 2025
1 parent e6a873c commit 9cd9f51
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -705,3 +705,27 @@ fj.DesertSunsetStyle // DesertSunsetStyle brings warm and deep hues inspired by
fj.PastelDreamStyle // PastelDreamStyle evokes a dreamy, soft pastel palette perfect for relaxed and whimsical visuals.
fj.TropicalVibeStyle // TropicalVibeStyle draws inspiration from lush tropical jungles, with bright and vibrant greens and yellows.
```
eg.
```go
package main
import (
"fmt"
"github.com/sivaosorg/fj"
)
var json []byte = []byte(`{"user":{"id":12345,"name":{"firstName":"John","lastName":"Doe"},"email":"[email protected]","phone":"+1-555-555-5555","address":{"street":"123 Main St","city":"Anytown","state":"CA","postalCode":"12345","country":"USA"},"roles":[{"roleId":"1","roleName":"Admin","permissions":[{"permissionId":"101","permissionName":"View Reports","allowedActions":["view","download"]},{"permissionId":"102","permissionName":"Manage Users","allowedActions":["create","update","delete"]}]},{"roleId":"2","roleName":"Editor","permissions":[{"permissionId":"201","permissionName":"Edit Content","allowedActions":["create","edit","publish"]},{"permissionId":"202","permissionName":"View Analytics","allowedActions":["view"]}]}],"status":"active","createdAt":"2025-01-01T10:00:00Z","lastLogin":"2025-01-12T15:30:00Z"}}`)
func main() {
ctx := fj.ParseBytes(json)
fmt.Println(ctx.WithStringColored(fj.NoirStyle))
}
```
> Output
<video src="./assets/fjjsoncolored.mp4" controls="controls" style="max-width: 730px;">
</video>
Binary file added assets/fjjsoncolored.mp4
Binary file not shown.

0 comments on commit 9cd9f51

Please sign in to comment.