Example from README gives different result
See original GitHub issueHi. I really like the idea with lave. Im testing out how to use it to let AlaSQL store itself to a string (so we can restore the state again).
First thing I did was to try the example in on the README. But I get a different result from what is described in the README.
First I installed the modules:
npm install lave
npm install escodegen
then I copy/paste the example from the README and run:
node << EOF
var generate = require('escodegen').generate
var lave = require('lave')
var a = [function(){}, new Date, new Buffer('A'), global]
a.splice(2, 0, a)
var js = lave(a, {generate, format: 'module'})
console.log(js)
EOF
The result I get is
export default a;
but the expected result in the README is described as
var a = [
function (){},
new Date(1456522677247),
null,
Buffer('QQ==', 'base64'),
(0, eval)('this')
];
a[2] = a;
export default a;
escodegen@1.8.0 + lave@1.1.5 on node@5.3.0 + nvm@3.3.12
Any inputs to why I am not getting same results as described in the README?
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Basic writing and formatting syntax - GitHub Docs
Create sophisticated formatting for your prose and code on GitHub with simple syntax.
Read more >New lines inside paragraph in README.md - Stack Overflow
shows every letter on a new line. However, it seems to me that pushing similar markdown source structure in README.md joins all the...
Read more >Github Readme Cheatsheet - Level Up Coding
The size of headings can be changed by adding multiple # Together. The greater the number of # is the smaller the heading...
Read more >README File – Everything you Need to Know - Great Learning
A README file is a text file that describes and launches a project. It comprises information that is frequently needed to grasp the...
Read more >How to Write a Good README File for Your GitHub Project
In simple words, we can describe a README file as a guide that gives users a detailed description of a project you have...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
you shouldn’t need an IIFE anymore, thanks to @fgnass: https://github.com/jed/lave/pull/23
Ok - ill try it out.
Any plans on updating the README example?