Skip to content

ES6 syntax for Using Transforms #22

Open
@natac13

Description

@natac13

I believe this to be a new issue after looking at the others.

I was working through the Using Transforms level and what I have setup is to write the code in ES6 then have babel transpile to ES5 and place in a dist/ folder. Here is my code.

'use strict';
import fs from 'fs';
import sprintf from 'sprintf';


let txt = fs.readFileSync('/home/natac/npm-global/lib/node_modules/browserify-adventure/problems/using_transforms/wake.txt', 'utf8');
let lines = txt.split('\n');
lines.forEach((line, index) => {
    if(index % 5 === 0) {
        console.log(sprintf('%3d %s', index, line));
    } else {
        console.log('   ' + line);
    }

});

When I run the ES5 version with node I get the desired output. However when using the provided command browserify -t brfs dist/transform.js | browserify-adventure verify I get an error that looks like....
browserifyerror

I have tired moving the file to the root folder with no success.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions