+
Skip to content

r-lib/toml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

toml

Read, Write, and Modify TOML files in R

Simple toolkit for parsing and generating TOML text. Based on toml_edit which allows for modifying toml while preserving order, comments, and whitespace.

We currently use a WebAssembly build of toml_edit such that we do not have to deal with Rust code in R and everything works without compilation on any platform, including WebR. When Rust becomes better supported on CRAN and WebR, we could consider binding to Rust directly, although it does not make too much of a difference.

Install

Installation requires no compilation:

install.packages("toml")

Example

The edit_toml function simply takes a TOML string and returns the modified TOML string:

# Read some TOML dadta
toml <- readLines('https://raw.githubusercontent.com/posit-dev/air/refs/heads/main/Cargo.toml')

# Modify some fields
toml <- edit_toml(toml, 'workspace.package.rust-version', '1.84')
toml <- edit_toml(toml, 'workspace.dependencies.bla', list(path = "./yolo", rev = "123"))
print(toml)

You can also parse the toml into an R list:

parse_toml(toml)

About

Read, Write, and Modify TOML files

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载