Fixes #1 Allow for multiple artifacts

This commit is contained in:
Nick Cipollo
2019-09-02 17:20:04 -04:00
parent 261c1fc08b
commit a698287254
24 changed files with 462 additions and 167 deletions

22
src/Artifact.ts Normal file
View File

@@ -0,0 +1,22 @@
import { basename } from "path";
import { readFileSync, statSync } from "fs";
export class Artifact {
readonly contentType: string
readonly name: string
readonly path: string
constructor(path: string, contentType: string = "raw") {
this.path = path
this.name = basename(path)
this.contentType = contentType;
}
get contentLength(): number {
return statSync(this.path).size
}
readFile(): Buffer {
return readFileSync(this.path)
}
}