Skip to content

Commit 6a30d3c

Browse files
authored
Merge pull request #8 from isimisi/main
changed fs.rmdir to fs.rm
2 parents 1a7cb8a + b5a955e commit 6a30d3c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ export async function rotatePDF(pdfBuffer: Buffer, direction: '90' | '180' | '27
146146

147147
/**
148148
* Converts a PDF to PDF/A.
149-
*
149+
*
150150
* @param pdfBuffer - Buffer of the PDF to convert
151151
* @param options - Options for the conversion
152152
* @param options.version - PDF/A version to convert to. Defaults to 1.
153-
* @returns
153+
* @returns
154154
*/
155155
export async function convertToPDFA(
156156
pdfBuffer: Buffer,
@@ -210,7 +210,7 @@ export async function renderPDFPagesToPNG(
210210
outFiles.push(await fs.readFile(outDir + '/' + i + '.png'));
211211
}
212212

213-
await fs.rmdir(outDir, { recursive: true });
213+
await fs.rm(outDir, { recursive: true });
214214
return outFiles;
215215
});
216216
} catch (e: any) {
@@ -234,8 +234,8 @@ export async function isValidPDF(pdfBuffer: Buffer): Promise<boolean> {
234234
*/
235235
export async function compressPDF(pdfBuffer: Buffer | string, encoding?: BufferEncoding): Promise<Buffer> {
236236
try {
237-
if(typeof pdfBuffer === 'string'){
238-
pdfBuffer = Buffer.from(pdfBuffer, encoding ?? 'base64')
237+
if (typeof pdfBuffer === 'string') {
238+
pdfBuffer = Buffer.from(pdfBuffer, encoding ?? 'base64');
239239
}
240240
const compressedPdf = await useTempFilesPDFInOut(pdfBuffer, async (input, output) => {
241241
await exec(

0 commit comments

Comments
 (0)