creat json file structure

Hi
I have a dataframe that change to json file and want to change structure change to json file.

df <- data.frame(name = c("a", "b", "c", "d"),
                 code = c(100:103))
df_js <- toJSON(df) 
[1] "{\n \"name\": [ \"a\", \"b\", \"c\", \"d\" ],\n\"code\": [ 100, 101, 102, 103 ] \n}"

library(tidyjson)
d %>% spread_all()
# A tbl_json: 1 x 2 tibble with a "JSON" attribute
  ..JSON                    document.id
  <chr>                           <int>
1 "{\"name\":[\"a\",\"b..."           1

but i want to get this exit:

{
"a": "100",
"b": "101",
"c": "102",
"d": "103"
}