Skip to content

Problems with typescript #58

@mateoc10

Description

@mateoc10

I'm having trouble using this with typescript.
I had to do some changes in the way to include it but after being able to import everything it fails when I try to use it.

import Seven = require('node-7z');
import { path7za } from '7zip-bin'

const seven = new Seven();
const stream = seven.extractFull(
            './example.7z',
            './',
            {
                $bin: path7za
            }
        ).then(resp => {
            console.log('finish', resp);
        })

Error in (undefined) /node-7z/src/flags.js
Module parse failed: node_modules/node-7z/src/flags.js Unexpected token (9:15)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (9:15)
@ ./~/node-7z/src/main.js 4:14-32

Error in (undefined) /node-7z/src/commands.js
Module parse failed: node_modules/node-7z/src/commands.js Unexpected token (2:10)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (2:10)
@ ./~/node-7z/src/main.js 10:17-38

Thanks for the help

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions