Install
With Go installed:
$ go install github.com/Victorystick/scrapscript/cmd/scrap@latest
scrap fetches scraps from this yard by default. New to the language? Start with the tutorial, or run scraps in your browser in the playground.
GET /$sha256
Retrieves a scrap by its SHA-256 hash.
Requested with Accept: application/scrap, that is its response type, otherwise text/plain.
Example
This scrap greets tagged data. Pipe a value into it and evaluate it:
$ echo '#friend { name = "aaron", times = 2 }
|> $source:71d9fe524fc0ab11b9ee6e6cfa3bc3d410a4c1b3884bc1b0256c51699730b1eb' \
| scrap eval
"yo aaron, yo aaron"
POST /
Stores the scrap in the request body and returns its SHA-256 hash.
Uploads are only accepted with the Content-Type: application/scrap header.
$ scrap push < greet.scrap
71d9fe524fc0ab11b9ee6e6cfa3bc3d410a4c1b3884bc1b0256c51699730b1eb