├── test ├── fixtures │ ├── empty │ ├── expected │ │ ├── empty │ │ ├── 1-linebreak │ │ ├── 1-line-0-linebreaks │ │ ├── 1-line-1-linebreaks │ │ ├── 2-linebreaks │ │ ├── 1-line-2-linebreaks │ │ ├── 2-line-0-linebreaks │ │ ├── 2-line-1-linebreaks │ │ ├── 2-line-2-linebreaks │ │ ├── multi-linebreaks │ │ └── lots-of-text │ ├── 1-linebreak │ ├── 1-line-0-linebreaks │ ├── 2-linebreaks │ ├── 1-line-1-linebreaks │ ├── 1-line-2-linebreaks │ ├── 2-line-0-linebreaks │ ├── 2-line-1-linebreaks │ ├── 2-line-2-linebreaks │ ├── multi-linebreaks │ └── lots-of-text └── stream-eachline_test.js ├── .gitignore ├── examples ├── each-with-index.rb ├── eachline-yay.js └── readline-broken.js ├── .travis.yml ├── .jshintrc ├── generate-fixtures.rb ├── LICENSE-MIT ├── package.json ├── Gruntfile.js ├── README.md └── lib └── stream-eachline.js /test/fixtures/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /test/fixtures/expected/empty: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /test/fixtures/1-linebreak: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/fixtures/1-line-0-linebreaks: -------------------------------------------------------------------------------- 1 | foo -------------------------------------------------------------------------------- /test/fixtures/2-linebreaks: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/fixtures/1-line-1-linebreaks: -------------------------------------------------------------------------------- 1 | foo 2 | -------------------------------------------------------------------------------- /test/fixtures/1-line-2-linebreaks: -------------------------------------------------------------------------------- 1 | foo 2 | 3 | -------------------------------------------------------------------------------- /test/fixtures/2-line-0-linebreaks: -------------------------------------------------------------------------------- 1 | foo 2 | bar -------------------------------------------------------------------------------- /test/fixtures/expected/1-linebreak: -------------------------------------------------------------------------------- 1 | [0] <> 2 | -------------------------------------------------------------------------------- /test/fixtures/2-line-1-linebreaks: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | -------------------------------------------------------------------------------- /test/fixtures/2-line-2-linebreaks: -------------------------------------------------------------------------------- 1 | foo 2 | bar 3 | 4 | -------------------------------------------------------------------------------- /test/fixtures/expected/1-line-0-linebreaks: -------------------------------------------------------------------------------- 1 | [0] 2 | -------------------------------------------------------------------------------- /test/fixtures/expected/1-line-1-linebreaks: -------------------------------------------------------------------------------- 1 | [0] 2 | -------------------------------------------------------------------------------- /test/fixtures/expected/2-linebreaks: -------------------------------------------------------------------------------- 1 | [0] <> 2 | [1] <> 3 | -------------------------------------------------------------------------------- /test/fixtures/expected/1-line-2-linebreaks: -------------------------------------------------------------------------------- 1 | [0] 2 | [1] <> 3 | -------------------------------------------------------------------------------- /test/fixtures/expected/2-line-0-linebreaks: -------------------------------------------------------------------------------- 1 | [0] 2 | [1] 3 | -------------------------------------------------------------------------------- /test/fixtures/expected/2-line-1-linebreaks: -------------------------------------------------------------------------------- 1 | [0] 2 | [1] 3 | -------------------------------------------------------------------------------- /test/fixtures/expected/2-line-2-linebreaks: -------------------------------------------------------------------------------- 1 | [0] 2 | [1] 3 | [2] <> 4 | -------------------------------------------------------------------------------- /test/fixtures/multi-linebreaks: -------------------------------------------------------------------------------- 1 | 2 | 3 | this 4 | is 5 | 6 | a 7 | 8 | 9 | test 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/fixtures/expected/multi-linebreaks: -------------------------------------------------------------------------------- 1 | [0] <> 2 | [1] <> 3 | [2] 4 | [3] 5 | [4] <> 6 | [5] 7 | [6] <> 8 | [7] <> 9 | [8] 10 | [9] <> 11 | [10] <> 12 | -------------------------------------------------------------------------------- /examples/each-with-index.rb: -------------------------------------------------------------------------------- 1 | require 'pp' 2 | 3 | result = [] 4 | 5 | STDIN.each_with_index do |line, idx| 6 | result << "[#{idx}] <#{line.chomp}>" 7 | end 8 | 9 | pp result 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | - "0.11" 5 | before_script: 6 | - npm install -g grunt-cli 7 | matrix: 8 | fast_finish: true 9 | allow_failures: 10 | - node_js: "0.11" 11 | -------------------------------------------------------------------------------- /examples/eachline-yay.js: -------------------------------------------------------------------------------- 1 | var eachline = require('../').eachline; 2 | 3 | eachline(process.stdin, function(line, index) { 4 | return '[' + index + '] <' + line + '>'; 5 | }, function(result) { 6 | console.log(result); 7 | }); 8 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "immed": true, 5 | "latedef": "nofunc", 6 | "newcap": true, 7 | "noarg": true, 8 | "sub": true, 9 | "undef": true, 10 | "unused": true, 11 | "boss": true, 12 | "eqnull": true, 13 | "node": true 14 | } 15 | -------------------------------------------------------------------------------- /examples/readline-broken.js: -------------------------------------------------------------------------------- 1 | var readline = require('readline'); 2 | 3 | function eachline(stream, linefn, donefn) { 4 | var result = []; 5 | var index = 0; 6 | 7 | return readline.createInterface({ 8 | input: stream, 9 | output: process.stdout, 10 | terminal: false, 11 | }).on('line', function(line) { 12 | result.push(linefn(line, index++)); 13 | }).on('close', function() { 14 | donefn(result); 15 | }); 16 | } 17 | 18 | eachline(process.stdin, function(line, index) { 19 | return '[' + index + '] <' + line + '>'; 20 | }, function(result) { 21 | console.log(result); 22 | }); 23 | -------------------------------------------------------------------------------- /generate-fixtures.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | fixturespath = 'test/fixtures/' 4 | 5 | # Get all fixture files 6 | files = Dir.entries(fixturespath).select {|f| !File.directory? fixturespath + f} 7 | 8 | # Generate "expected" files 9 | files.each do |filename| 10 | srcpath = "#{fixturespath}#{filename}" 11 | destpath = "#{fixturespath}expected/#{filename}" 12 | puts "#{srcpath} -> #{destpath}" 13 | File.open(destpath, 'w+') do |dest| 14 | File.open(srcpath, 'r+') do |src| 15 | # For each line of source file, write an output line to dest file. 16 | src.each_with_index do |line, idx| 17 | dest.puts "[#{idx}] <#{line.chomp}>" 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 "Cowboy" Ben Alman 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "stream-eachline", 3 | "description": "Like readline or split, but behaves more like ruby's .each_with_index method when streams lack trailing newlines.", 4 | "version": "0.1.0", 5 | "homepage": "https://github.com/cowboy/node-stream-eachline", 6 | "author": { 7 | "name": "\"Cowboy\" Ben Alman", 8 | "url": "http://benalman.com/" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git://github.com/cowboy/node-stream-eachline.git" 13 | }, 14 | "bugs": { 15 | "url": "https://github.com/cowboy/node-stream-eachline/issues" 16 | }, 17 | "licenses": [ 18 | { 19 | "type": "MIT", 20 | "url": "https://github.com/cowboy/node-stream-eachline/blob/master/LICENSE-MIT" 21 | } 22 | ], 23 | "main": "lib/stream-eachline", 24 | "engines": { 25 | "node": ">= 0.10.0" 26 | }, 27 | "scripts": { 28 | "test": "grunt nodeunit" 29 | }, 30 | "devDependencies": { 31 | "grunt-contrib-jshint": "^0.10.0", 32 | "grunt-contrib-nodeunit": "^0.4.0", 33 | "grunt-contrib-watch": "^0.6.1", 34 | "grunt": "~0.4.1" 35 | }, 36 | "keywords": [ 37 | "stream", 38 | "lines", 39 | "each", 40 | "readline", 41 | "stdio", 42 | "stdin", 43 | "split" 44 | ] 45 | } 46 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = function(grunt) { 4 | 5 | // Project configuration. 6 | grunt.initConfig({ 7 | nodeunit: { 8 | files: ['test/**/*_test.js'], 9 | }, 10 | jshint: { 11 | options: { 12 | jshintrc: '.jshintrc' 13 | }, 14 | gruntfile: { 15 | src: 'Gruntfile.js' 16 | }, 17 | lib: { 18 | src: ['lib/**/*.js'] 19 | }, 20 | test: { 21 | src: ['test/**/*.js'] 22 | }, 23 | }, 24 | watch: { 25 | gruntfile: { 26 | files: '<%= jshint.gruntfile.src %>', 27 | tasks: ['jshint:gruntfile'] 28 | }, 29 | lib: { 30 | files: '<%= jshint.lib.src %>', 31 | tasks: ['jshint:lib', 'nodeunit'] 32 | }, 33 | test: { 34 | files: '<%= jshint.test.src %>', 35 | tasks: ['jshint:test', 'nodeunit'] 36 | }, 37 | fixtures: { 38 | files: 'test/fixtures/**', 39 | tasks: ['nodeunit'] 40 | }, 41 | }, 42 | }); 43 | 44 | grunt.loadNpmTasks('grunt-contrib-nodeunit'); 45 | grunt.loadNpmTasks('grunt-contrib-jshint'); 46 | grunt.loadNpmTasks('grunt-contrib-watch'); 47 | 48 | grunt.registerTask('test', ['jshint', 'nodeunit']); 49 | grunt.registerTask('default', ['test', 'watch']); 50 | 51 | }; 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # stream-eachline [![Build Status](https://secure.travis-ci.org/cowboy/node-stream-eachline.png?branch=master)](http://travis-ci.org/cowboy/node-stream-eachline) 2 | 3 | Like readline or split, but behaves more like ruby's `.each_with_index` method when streams lack trailing newlines. 4 | 5 | ## Getting Started 6 | Install the module with: `npm install stream-eachline` 7 | 8 | ```javascript 9 | var eachline = require('stream-eachline').eachline; 10 | 11 | // Modify each line in process.stdin input stream (while streaming) 12 | // and when done log an array of modified lines. 13 | eachline(process.stdin, function(line, index) { 14 | return '[' + index + '] ' + line.toUpperCase(); 15 | }, function(lines) { 16 | console.log('Array of modified lines:', lines); 17 | }); 18 | 19 | // The following examples all do the same thing: 20 | eachline(process.stdin, function(line, index) { 21 | return line; 22 | }, function(lines) { 23 | doSomethingWithLines(lines); 24 | }); 25 | 26 | // You may omit lineFunction if you don't need to modify the streamed lines. 27 | eachline(process.stdin, doSomethingWithLines); 28 | 29 | // You may omit instream if you want to process process.stdin's lines. 30 | eachline(doSomethingWithLines); 31 | ``` 32 | 33 | ## Documentation 34 | 35 | `eachline([instream], [lineFunction], doneFunction)` 36 | 37 | ## Why this library? 38 | 39 | ```bash 40 | # I couldn't get readline to give me the last line of a stream if there 41 | # was no trailing newline. 42 | $ echo -en 'foo\nbar\nbaz\n' | node examples/readline-broken.js 43 | [ '[0] ', '[1] ', '[2] ' ] 44 | 45 | $ echo -en 'foo\nbar\nbaz' | node examples/readline-broken.js 46 | [ '[0] ', '[1] ' ] 47 | 48 | 49 | # This is the behavior I expected, based on my experience with ruby's 50 | # STDIN.each_with_index method. 51 | $ echo -en 'foo\nbar\nbaz\n' | ruby examples/each-with-index.rb 52 | ["[0] ", "[1] ", "[2] "] 53 | 54 | $ echo -en 'foo\nbar\nbaz' | ruby examples/each-with-index.rb 55 | ["[0] ", "[1] ", "[2] "] 56 | 57 | 58 | # This lib behaves more like ruby's STDIN.each_with_index method. 59 | $ echo -en 'foo\nbar\nbaz\n' | node examples/eachline-yay.js 60 | [ '[0] ', '[1] ', '[2] ' ] 61 | 62 | $ echo -en 'foo\nbar\nbaz' | node examples/eachline-yay.js 63 | [ '[0] ', '[1] ', '[2] ' ] 64 | ``` 65 | 66 | ## Contributing 67 | In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). 68 | 69 | ## Release History 70 | _(Nothing yet)_ 71 | 72 | ## License 73 | Copyright (c) 2014 "Cowboy" Ben Alman 74 | Licensed under the MIT license. 75 | -------------------------------------------------------------------------------- /lib/stream-eachline.js: -------------------------------------------------------------------------------- 1 | /* 2 | * stream-eachline 3 | * https://github.com/cowboy/node-stream-eachline 4 | * 5 | * Copyright (c) 2014 "Cowboy" Ben Alman 6 | * Licensed under the MIT license. 7 | */ 8 | 9 | 'use strict'; 10 | 11 | exports.eachline = function(stream, linefn, donefn) { 12 | if (typeof stream === 'function') { 13 | donefn = linefn; 14 | linefn = stream; 15 | stream = process.stdin; 16 | } 17 | if (typeof donefn === 'undefined') { 18 | donefn = linefn; 19 | linefn = String; 20 | } 21 | 22 | var result = []; 23 | var buffer = ''; 24 | var index = 0; 25 | 26 | // Flush complete lines. 27 | function flushLines() { 28 | // If the buffer doesn't contain linebreaks, there's nothing to do. 29 | if (!/\n/.test(buffer)) { return; } 30 | // Get all but the last line. 31 | var lines = buffer.split('\n'); 32 | // (Store the last line for later) 33 | buffer = lines.pop(); 34 | // For each line, call linefn with the line and an index. 35 | lines.forEach(function(line) { 36 | result.push(linefn(line, index++)); 37 | }); 38 | } 39 | 40 | // Set encoding (should this be an option? is there a way to auto-detect?) 41 | stream.setEncoding('utf8'); 42 | 43 | // Read the stream. 44 | stream.on('readable', function() { 45 | var chunk = stream.read(); 46 | if (chunk === null) { return; } 47 | // Append the chunk to the buffer and flush complete lines. 48 | buffer += chunk; 49 | flushLines(); 50 | }); 51 | 52 | // The stream has ended. 53 | stream.on('end', function() { 54 | // If any text still exists in the buffer, add another linebreak. This is 55 | // the super-special magical bit that readline seems to ignore. 56 | if (buffer !== '') { 57 | buffer += '\n'; 58 | } 59 | flushLines(); 60 | // All done! 61 | donefn(result); 62 | }); 63 | 64 | // Return the stream. Because, why not? 65 | return stream; 66 | }; 67 | 68 | 69 | // I can't seem to get it to work with readline. 70 | 71 | // var readline = require('readline'); 72 | // exports.eachline = function(stream, linefn, donefn) { 73 | // var result = []; 74 | // var index = 0; 75 | 76 | // return readline.createInterface({ 77 | // input: stream, 78 | // output: process.stdout, 79 | // terminal: false, 80 | // }).on('line', function(line) { 81 | // result.push(linefn(line, index++)); 82 | // }).on('close', function() { 83 | // donefn(result); 84 | // }); 85 | // }; 86 | 87 | 88 | // Or with split. 89 | 90 | // var split = require('split'); 91 | // exports.eachline = function(stream, linefn, donefn) { 92 | // var result = []; 93 | // var index = 0; 94 | 95 | // return stream.pipe(split()).on('data', function(line) { 96 | // result.push(linefn(line, index++)); 97 | // }).on('close', function() { 98 | // result.pop(); // not quite 99 | // donefn(result); 100 | // }); 101 | // }; 102 | -------------------------------------------------------------------------------- /test/stream-eachline_test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var eachline = require('../lib/stream-eachline.js').eachline; 4 | var fs = require('fs'); 5 | 6 | /* 7 | ======== A Handy Little Nodeunit Reference ======== 8 | https://github.com/caolan/nodeunit 9 | 10 | Test methods: 11 | test.expect(numAssertions) 12 | test.done() 13 | Test assertions: 14 | test.ok(value, [message]) 15 | test.equal(actual, expected, [message]) 16 | test.notEqual(actual, expected, [message]) 17 | test.deepEqual(actual, expected, [message]) 18 | test.notDeepEqual(actual, expected, [message]) 19 | test.strictEqual(actual, expected, [message]) 20 | test.notStrictEqual(actual, expected, [message]) 21 | test.throws(block, [error], [message]) 22 | test.doesNotThrow(block, [error], [message]) 23 | test.ifError(value) 24 | */ 25 | 26 | // Convert a line to a string like: [i] 27 | function modifyLine(line, index) { 28 | return '[' + index + '] <' + line + '>'; 29 | } 30 | 31 | // Self-explanatory? 32 | function getFixtureStream(name) { 33 | return fs.createReadStream('test/fixtures/' + name); 34 | } 35 | function getFixtureExpected(name) { 36 | var str = fs.readFileSync('test/fixtures/expected/' + name, 'utf8'); 37 | return str.split('\n').slice(0, -1); 38 | } 39 | 40 | // This is probably the worst idea ever. 41 | var fakeStdinStream; 42 | Object.defineProperty(process, 'stdin', { 43 | get: function() { 44 | return fakeStdinStream; 45 | }, 46 | }); 47 | 48 | exports['eachline args'] = { 49 | setUp: function(done) { 50 | fakeStdinStream = getFixtureStream('2-line-1-linebreaks'); 51 | done(); 52 | }, 53 | 'all arguments': function(test) { 54 | test.expect(1); 55 | eachline(process.stdin, String, function(actual) { 56 | test.deepEqual(actual, ['foo', 'bar']); 57 | test.done(); 58 | }.bind(this)); 59 | }, 60 | 'no lineFunction': function(test) { 61 | test.expect(1); 62 | eachline(process.stdin, function(actual) { 63 | test.deepEqual(actual, ['foo', 'bar']); 64 | test.done(); 65 | }.bind(this)); 66 | }, 67 | 'no instream': function(test) { 68 | test.expect(1); 69 | eachline(String, function(actual) { 70 | test.deepEqual(actual, ['foo', 'bar']); 71 | test.done(); 72 | }.bind(this)); 73 | }, 74 | 'no instream, no lineFunction': function(test) { 75 | test.expect(1); 76 | eachline(function(actual) { 77 | test.deepEqual(actual, ['foo', 'bar']); 78 | test.done(); 79 | }.bind(this)); 80 | }, 81 | }; 82 | 83 | exports['eachline'] = {}; 84 | 85 | // Create one test per fixture/expected file. 86 | fs.readdirSync('test/fixtures').filter(function(filename) { 87 | return !fs.statSync('test/fixtures/' + filename).isDirectory(); 88 | }).forEach(function(name) { 89 | exports['eachline'][name] = function(test) { 90 | test.expect(1); 91 | eachline( 92 | // Read from this stream (file, not stdin, in this case). 93 | getFixtureStream(name), 94 | // Modify each line as it comes in. 95 | modifyLine, 96 | // When done processing input stream lines, assert that what's generated 97 | // matches the output generated by generate-fixtures.rb 98 | function(actual) { 99 | test.deepEqual(actual, getFixtureExpected(name)); 100 | test.done(); 101 | } 102 | ); 103 | }; 104 | }); 105 | -------------------------------------------------------------------------------- /test/fixtures/lots-of-text: -------------------------------------------------------------------------------- 1 | You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic. 2 | 3 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 4 | 5 | The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die. 6 | 7 | The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die. 8 | 9 | You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic. 10 | 11 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 12 | 13 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 14 | 15 | Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people. Like pit bulls. The dog of dogs. Pit bull can be the right man's best friend... or the wrong man's worst enemy. You going to give me a dog for a pet, give me a pit bull. Give me... Raoul. Right, Omar? Give me Raoul. 16 | 17 | The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die. 18 | 19 | Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. 20 | 21 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 22 | 23 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 24 | 25 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 26 | 27 | You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic. 28 | 29 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 30 | 31 | You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. 32 | 33 | You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. 34 | 35 | Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. 36 | 37 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 38 | 39 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 40 | 41 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 42 | 43 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 44 | 45 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 46 | 47 | Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people. Like pit bulls. The dog of dogs. Pit bull can be the right man's best friend... or the wrong man's worst enemy. You going to give me a dog for a pet, give me a pit bull. Give me... Raoul. Right, Omar? Give me Raoul. 48 | 49 | You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic. 50 | 51 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 52 | 53 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 54 | 55 | Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people. Like pit bulls. The dog of dogs. Pit bull can be the right man's best friend... or the wrong man's worst enemy. You going to give me a dog for a pet, give me a pit bull. Give me... Raoul. Right, Omar? Give me Raoul. 56 | 57 | Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. 58 | 59 | The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die. 60 | 61 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 62 | 63 | You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. 64 | 65 | Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. 66 | 67 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 68 | 69 | Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. 70 | 71 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 72 | 73 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 74 | 75 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 76 | 77 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 78 | 79 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 80 | 81 | The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die. 82 | 83 | You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic. 84 | 85 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 86 | 87 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 88 | 89 | Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. 90 | 91 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 92 | 93 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 94 | 95 | Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. 96 | 97 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 98 | 99 | Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. 100 | 101 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 102 | 103 | Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people. Like pit bulls. The dog of dogs. Pit bull can be the right man's best friend... or the wrong man's worst enemy. You going to give me a dog for a pet, give me a pit bull. Give me... Raoul. Right, Omar? Give me Raoul. 104 | 105 | Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. 106 | 107 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 108 | 109 | You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. 110 | 111 | Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people. Like pit bulls. The dog of dogs. Pit bull can be the right man's best friend... or the wrong man's worst enemy. You going to give me a dog for a pet, give me a pit bull. Give me... Raoul. Right, Omar? Give me Raoul. 112 | 113 | The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die. 114 | 115 | You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. 116 | 117 | Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. 118 | 119 | Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. 120 | 121 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 122 | 123 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 124 | 125 | Yeah, I like animals better than people sometimes... Especially dogs. Dogs are the best. Every time you come home, they act like they haven't seen you in a year. And the good thing about dogs... is they got different dogs for different people. Like pit bulls. The dog of dogs. Pit bull can be the right man's best friend... or the wrong man's worst enemy. You going to give me a dog for a pet, give me a pit bull. Give me... Raoul. Right, Omar? Give me Raoul. 126 | 127 | You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. 128 | 129 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 130 | 131 | The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die. 132 | 133 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 134 | 135 | Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. 136 | 137 | Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. 138 | 139 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 140 | 141 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 142 | 143 | The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die. 144 | 145 | You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. 146 | 147 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 148 | 149 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 150 | 151 | You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic. 152 | 153 | Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. 154 | 155 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 156 | 157 | You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic. 158 | 159 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 160 | 161 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 162 | 163 | You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic. 164 | 165 | Do you see any Teletubbies in here? Do you see a slender plastic tag clipped to my shirt with my name printed on it? Do you see a little Asian child with a blank expression on his face sitting outside on a mechanical helicopter that shakes when you put quarters in it? No? Well, that's what you see at a toy store. And you must think you're in a toy store, because you're here shopping for an infant named Jeb. 166 | 167 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 168 | 169 | Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. 170 | 171 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 172 | 173 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 174 | 175 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 176 | 177 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 178 | 179 | You think water moves fast? You should see ice. It moves like it has a mind. Like it knows it killed the world once and got a taste for murder. After the avalanche, it took us a week to climb out. Now, I don't know exactly when we turned on each other, but I know that seven of us survived the slide... and only five made it out. Now we took an oath, that I'm breaking now. We said we'd say it was the snow that killed the other two, but it wasn't. Nature is lethal but it doesn't hold a candle to man. 180 | 181 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 182 | 183 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 184 | 185 | The path of the righteous man is beset on all sides by the iniquities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy My brothers. And you will know My name is the Lord when I lay My vengeance upon thee. 186 | 187 | Well, the way they make shows is, they make one show. That show's called a pilot. Then they show that show to the people who make shows, and on the strength of that one show they decide if they're going to make more shows. Some pilots get picked and become television programs. Some don't, become nothing. She starred in one of the ones that became nothing. 188 | 189 | You see? It's curious. Ted did figure it out - time travel. And when we get back, we gonna tell everyone. How it's possible, how it's done, what the dangers are. But then why fifty years in the future when the spacecraft encounters a black hole does the computer call it an 'unknown entry event'? Why don't they know? If they don't know, that means we never told anyone. And if we never told anyone it means we never made it back. Hence we die down here. Just as a matter of deductive logic. 190 | 191 | Now that we know who you are, I know who I am. I'm not a mistake! It all makes sense! In a comic, you know how you can tell who the arch-villain's going to be? He's the exact opposite of the hero. And most times they're friends, like you and me! I should've known way back when... You know why, David? Because of the kids. They called me Mr Glass. 192 | 193 | Like you, I used to think the world was this great place where everybody lived by the same standards I did, then some kid with a nail showed me I was living in his world, a world where chaos rules not order, a world where righteousness is not rewarded. That's Cesar's world, and if you're not willing to play by his rules, then you're gonna have to pay the price. 194 | 195 | The lysine contingency - it's intended to prevent the spread of the animals is case they ever got off the island. Dr. Wu inserted a gene that makes a single faulty enzyme in protein metabolism. The animals can't manufacture the amino acid lysine. Unless they're continually supplied with lysine by us, they'll slip into a coma and die. 196 | 197 | Your bones don't break, mine do. That's clear. Your cells react to bacteria and viruses differently than mine. You don't get sick, I do. That's also clear. But for some reason, you and I react the exact same way to water. We swallow it too fast, we choke. We get some in our lungs, we drown. However unreal it may seem, we are connected, you and I. We're on the same curve, just on opposite ends. 198 | -------------------------------------------------------------------------------- /test/fixtures/expected/lots-of-text: -------------------------------------------------------------------------------- 1 | [0] 2 | [1] <> 3 | [2] 4 | [3] <> 5 | [4] 6 | [5] <> 7 | [6] 8 | [7] <> 9 | [8] 10 | [9] <> 11 | [10] 12 | [11] <> 13 | [12] 14 | [13] <> 15 | [14] 16 | [15] <> 17 | [16] 18 | [17] <> 19 | [18] 20 | [19] <> 21 | [20] 22 | [21] <> 23 | [22] 24 | [23] <> 25 | [24] 26 | [25] <> 27 | [26] 28 | [27] <> 29 | [28] 30 | [29] <> 31 | [30] 32 | [31] <> 33 | [32] 34 | [33] <> 35 | [34] 36 | [35] <> 37 | [36] 38 | [37] <> 39 | [38] 40 | [39] <> 41 | [40] 42 | [41] <> 43 | [42] 44 | [43] <> 45 | [44] 46 | [45] <> 47 | [46] 48 | [47] <> 49 | [48] 50 | [49] <> 51 | [50] 52 | [51] <> 53 | [52] 54 | [53] <> 55 | [54] 56 | [55] <> 57 | [56] 58 | [57] <> 59 | [58] 60 | [59] <> 61 | [60] 62 | [61] <> 63 | [62] 64 | [63] <> 65 | [64] 66 | [65] <> 67 | [66] 68 | [67] <> 69 | [68] 70 | [69] <> 71 | [70] 72 | [71] <> 73 | [72] 74 | [73] <> 75 | [74] 76 | [75] <> 77 | [76] 78 | [77] <> 79 | [78] 80 | [79] <> 81 | [80] 82 | [81] <> 83 | [82] 84 | [83] <> 85 | [84] 86 | [85] <> 87 | [86] 88 | [87] <> 89 | [88] 90 | [89] <> 91 | [90] 92 | [91] <> 93 | [92] 94 | [93] <> 95 | [94] 96 | [95] <> 97 | [96] 98 | [97] <> 99 | [98] 100 | [99] <> 101 | [100] 102 | [101] <> 103 | [102] 104 | [103] <> 105 | [104] 106 | [105] <> 107 | [106] 108 | [107] <> 109 | [108] 110 | [109] <> 111 | [110] 112 | [111] <> 113 | [112] 114 | [113] <> 115 | [114] 116 | [115] <> 117 | [116] 118 | [117] <> 119 | [118] 120 | [119] <> 121 | [120] 122 | [121] <> 123 | [122] 124 | [123] <> 125 | [124] 126 | [125] <> 127 | [126] 128 | [127] <> 129 | [128] 130 | [129] <> 131 | [130] 132 | [131] <> 133 | [132] 134 | [133] <> 135 | [134] 136 | [135] <> 137 | [136] 138 | [137] <> 139 | [138] 140 | [139] <> 141 | [140] 142 | [141] <> 143 | [142] 144 | [143] <> 145 | [144] 146 | [145] <> 147 | [146] 148 | [147] <> 149 | [148] 150 | [149] <> 151 | [150] 152 | [151] <> 153 | [152] 154 | [153] <> 155 | [154] 156 | [155] <> 157 | [156] 158 | [157] <> 159 | [158] 160 | [159] <> 161 | [160] 162 | [161] <> 163 | [162] 164 | [163] <> 165 | [164] 166 | [165] <> 167 | [166] 168 | [167] <> 169 | [168] 170 | [169] <> 171 | [170] 172 | [171] <> 173 | [172] 174 | [173] <> 175 | [174] 176 | [175] <> 177 | [176] 178 | [177] <> 179 | [178] 180 | [179] <> 181 | [180] 182 | [181] <> 183 | [182] 184 | [183] <> 185 | [184] 186 | [185] <> 187 | [186] 188 | [187] <> 189 | [188] 190 | [189] <> 191 | [190] 192 | [191] <> 193 | [192] 194 | [193] <> 195 | [194] 196 | [195] <> 197 | [196] 198 | --------------------------------------------------------------------------------