An example module to show how to autogenerate a README.md-file. The code implements addition.
npm install example
['1', '2'].map(parseInt) | |
// output [1, NaN] | |
['1', '2'].map(Number) | |
// output [1, 2] | |
Why? |
var levelup = require('levelup'); | |
var db = levelup('levelup-leak-db'); | |
db.put('foo', 'bar'); | |
function read() { | |
db.readStream().once('end', read); | |
} | |
read(); |
var Transform = require('stream').Transform | |
var assert = require('assert') | |
var stream = new Transform({objectMode: true}) | |
var read = function(stream, callback) { | |
var actual = [] | |
var data | |
function onReadable () { | |
while((data = stream.read()) !== null) { |
node-snappy|merged⚡ ⇒ gdb --args node failure.js | |
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb 6 22:51:23 UTC 2013) | |
Copyright 2004 Free Software Foundation, Inc. | |
GDB is free software, covered by the GNU General Public License, and you are | |
welcome to change it and/or distribute copies of it under certain conditions. | |
Type "show copying" to see the conditions. | |
There is absolutely no warranty for GDB. Type "show warranty" for details. | |
This GDB was configured as "x86_64-apple-darwin"...Reading symbols for shared libraries ........ done | |
(gdb) run |
function fullName (firstName, secondName) { | |
return firstName + ' ' + secondName; | |
} | |
function fullName2(obj) { | |
return obj.firstName + ' ' + obj.secondName; | |
} | |
console.log(beepboop(fullName2, ['firstName', 'secondName'])('David', 'Hipsterson')); | |
console.log(fullName('David', 'Hipsterson')); |
import toArticleJson from ‘html-to-article-json’; | |
const embed1 = toArticleJson(‘<iframe src="https://www.youtube.com/embed/pDVmldTurqk"></iframe>’ | |
const embed2 = toArticleJson(‘<iframe src="//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fwww.youtube.com%2Fembed%2F3rS6mZUo3fg%3Ffeature%3Doembed"></iframe>’) |
import toArticleJson from ‘html-to-article-json’; | |
const embed1 = toArticleJson( | |
'<iframe src=”https://www.youtube.com/embed/pDVmldTurqk"></iframe>' | |
); | |
const embed2 = toArticleJson( | |
'<iframe src=”//cdn.embedly.com/widgets/media.html?src=http%3A%2F%2Fwww.youtube.com%2Fembed%2F3rS6mZUo3fg%3Ffeature%3Doembed"></iframe>' | |
); |
import toAmp from ‘article-json-to-amp’; | |
const amp = toAmp(articleJson); |