Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ES6 syntax for Using Transforms #22

Open
natac13 opened this issue Oct 17, 2015 · 0 comments
Open

ES6 syntax for Using Transforms #22

natac13 opened this issue Oct 17, 2015 · 0 comments

Comments

@natac13
Copy link

natac13 commented Oct 17, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant