@architect/package packages @architect projects as AWS::Serverless
-compatible JSON. Converts project .arc
files into a AWS Serverless Application
Model (SAM)-compatible format.
npm i @architect/package
All of this module's methods take as input an @architect/parser-parsed
@architect project .arc
file.
Depending on the size of your @architect project and its passed-in parsed .arc
file(the arc
parameter), will invoke either toCFN
for larger projects
or toSAM
for smaller ones.
let parse = require('@architect/parser')
let pkg = require('@architect/package')
// fake out an .arc file as a string
let arcString = `
@app
mybasicapp
@http
get /
`
// parse .arc string into a plain javascript object
let arc = parse(arcString)
// export as sam
let sam = pkg(arc)
console.log(sam)