Using Babel 6 + grunt to work with ES6 – how to transform require statements?

Using Babel 6 + grunt to work with ES6 – how to transform require statements? https://stackoverflow.com/questions/41067220/using-babel-grunt-to-work-with-es6-how-to-transform-require-statements Browserify will handle the import bindings for the ES6 modules. Also a package named babelify will help to handle your babel browserify transform. The following seems to work well: Use babel-cli instead of babel. Step 1. It’s worth noting…

Read More

`bluebird@3.5.1`: MongoDB `mongoose@4.13.7` `Promises` library

bluebird@3.5.1: MongoDB mongoose@4.13.7 Promises library > Warning: a promise was created in a handler > at internal/process/next_tick.js:180:9 but was not returned from it, > see http://goo.gl/rRqMUw > at model.Query.ret [as execAsync] > (eval at makeNodePromisifiedEval > (/home/bike/github/SmartPlug-Foodtruck.kr/node_modules/bluebird/js/release/promisify.js:184:12), <anonymous>:8:21) > mongoose Promises : bluebird http://mongoosejs.com/docs/promises.html Built-in Promises Mongoose async operations, like .save() and queries, return Promises/A+…

Read More

`module.exports` vs. `export default` in Node.js and ES6

https://stackoverflow.com/questions/40294870/module-exports-vs-export-default-in-node-js-and-es6 module.exports vs. export default in Node.js and ES6 ES6 default exports are actually also named exports, except that default is a “reserved” name and there is special syntax support for it. Lets have a look how Babel compiles named and default exports: // input export const foo = 42; export default 21; // output…

Read More