0% found this document useful (0 votes)
20 views49 pages

Full JavaScript Frameworks For Modern Web Development, 2nd Edition Sufyan Bin Uzayr Ebook All Chapters

ebook

Uploaded by

aniiealors
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views49 pages

Full JavaScript Frameworks For Modern Web Development, 2nd Edition Sufyan Bin Uzayr Ebook All Chapters

ebook

Uploaded by

aniiealors
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Full download ebooks at https://ebookmeta.

com

JavaScript Frameworks for Modern Web


Development, 2nd Edition Sufyan Bin Uzayr

For dowload this book click link below


https://ebookmeta.com/product/javascript-frameworks-for-
modern-web-development-2nd-edition-sufyan-bin-uzayr/

OR CLICK BUTTON

DOWLOAD NOW
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Conquering JavaScript: Three.js Sufyan Bin Uzayr

https://ebookmeta.com/product/conquering-javascript-three-js-
sufyan-bin-uzayr/

Conquering JavaScript: D3.js Sufyan Bin Uzayr

https://ebookmeta.com/product/conquering-javascript-d3-js-sufyan-
bin-uzayr/

Mastering UI Mockups and Frameworks: A Beginner's Guide


1st Edition Sufyan Bin Uzayr

https://ebookmeta.com/product/mastering-ui-mockups-and-
frameworks-a-beginners-guide-1st-edition-sufyan-bin-uzayr/

Mastering MySQL for Web : a Beginner's Guide. First


Edition. Edition Sufyan Bin Uzayr (Ed.)

https://ebookmeta.com/product/mastering-mysql-for-web-a-
beginners-guide-first-edition-edition-sufyan-bin-uzayr-ed/
Not Paying the Rent 2nd Edition Sufyan Bin Uzayr

https://ebookmeta.com/product/not-paying-the-rent-2nd-edition-
sufyan-bin-uzayr/

Mastering Python for Web: A Beginner's Guide (Mastering


Computer Science) 1st Edition Sufyan Bin Uzayr

https://ebookmeta.com/product/mastering-python-for-web-a-
beginners-guide-mastering-computer-science-1st-edition-sufyan-
bin-uzayr/

JavaScript Frameworks for Modern Web Dev 1st Edition


Tim Ambler Nicholas Cloud

https://ebookmeta.com/product/javascript-frameworks-for-modern-
web-dev-1st-edition-tim-ambler-nicholas-cloud/

VuePress Quick Start Guide Sufyan Bin Uzayr

https://ebookmeta.com/product/vuepress-quick-start-guide-sufyan-
bin-uzayr/

Getting the Most out of Node.js Frameworks: The


Essential Tools and Libraries 1st Edition Sufyan Bin
Uzayr

https://ebookmeta.com/product/getting-the-most-out-of-node-js-
frameworks-the-essential-tools-and-libraries-1st-edition-sufyan-
bin-uzayr/
JavaScript Frameworks
for Modern Web
Development
The Essential Frameworks, Libraries,
and Tools to Learn Right Now

Second Edition

Sufyan bin Uzayr
Nicholas Cloud
Tim Ambler

www.allitebooks.com
JavaScript Frameworks for
Modern Web Development
The Essential Frameworks, Libraries,
and Tools to Learn Right Now
Second Edition

Sufyan bin Uzayr


Nicholas Cloud
Tim Ambler

www.allitebooks.com
JavaScript Frameworks for Modern Web Development
Sufyan bin Uzayr Nicholas Cloud
Al Manama, United Arab Emirates Florissant, MO, USA
Tim Ambler
Nashville, TN, USA

ISBN-13 (pbk): 978-1-4842-4994-9 ISBN-13 (electronic): 978-1-4842-4995-6


https://doi.org/10.1007/978-1-4842-4995-6

Copyright © 2019 by Sufyan bin Uzayr, Nicholas Cloud, Tim Ambler


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Louise Corrigan
Development Editor: James Markham
Coordinating Editor: Nancy Chen
Cover designed by eStudioCalamar
Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street,
6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@springer-
sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member
(owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a
Delaware corporation.
For information on translations, please e-mail [email protected], or visit http://www.apress.com/
rights-permissions.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/9781484249949. For more
detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper

www.allitebooks.com
For Anza
—Sufyan bin Uzayr

www.allitebooks.com
Table of Contents
About the Authors����������������������������������������������������������������������������������������������������xv

About the Technical Reviewer�������������������������������������������������������������������������������xvii


Acknowledgments��������������������������������������������������������������������������������������������������xix

Introduction������������������������������������������������������������������������������������������������������������xxi

Part I: Development Tools������������������������������������������������������������������������������� 1


Chapter 1: Grunt������������������������������������������������������������������������������������������������������� 3
Installing Grunt������������������������������������������������������������������������������������������������������������������������������ 4
How Grunt Works�������������������������������������������������������������������������������������������������������������������������� 4
Gruntfile.js������������������������������������������������������������������������������������������������������������������������������� 5
Tasks��������������������������������������������������������������������������������������������������������������������������������������� 7
Plugins������������������������������������������������������������������������������������������������������������������������������������� 8
Configuration��������������������������������������������������������������������������������������������������������������������������� 8
Adding Grunt to Your Project��������������������������������������������������������������������������������������������������������� 8
Maintaining a Sane Grunt Structure���������������������������������������������������������������������������������������� 9
Working with Tasks��������������������������������������������������������������������������������������������������������������������� 12
Managing Configuration�������������������������������������������������������������������������������������������������������� 12
Task Descriptions������������������������������������������������������������������������������������������������������������������ 13
Asynchronous Tasks�������������������������������������������������������������������������������������������������������������� 14
Task Dependencies���������������������������������������������������������������������������������������������������������������� 15
Multi-Tasks���������������������������������������������������������������������������������������������������������������������������� 16
Multi-Task Options����������������������������������������������������������������������������������������������������������������� 18
Configuration Templates�������������������������������������������������������������������������������������������������������� 19
Command-Line Options��������������������������������������������������������������������������������������������������������� 20
Providing Feedback��������������������������������������������������������������������������������������������������������������� 21
Handling Errors���������������������������������������������������������������������������������������������������������������������� 22
v

www.allitebooks.com
Table of Contents

Interacting with the File System������������������������������������������������������������������������������������������������� 22


Source-Destination Mappings����������������������������������������������������������������������������������������������� 23
Watching for File Changes����������������������������������������������������������������������������������������������������� 26
Creating Plugins�������������������������������������������������������������������������������������������������������������������������� 31
Getting Started���������������������������������������������������������������������������������������������������������������������� 31
Creating the Task������������������������������������������������������������������������������������������������������������������� 32
Publishing to npm������������������������������������������������������������������������������������������������������������������ 36
Summary������������������������������������������������������������������������������������������������������������������������������������ 36
Related Resources���������������������������������������������������������������������������������������������������������������������� 37

Chapter 2: Yeoman�������������������������������������������������������������������������������������������������� 39
Installing Yeoman������������������������������������������������������������������������������������������������������������������������ 40
Creating Your First Project���������������������������������������������������������������������������������������������������������� 40
Subcommands����������������������������������������������������������������������������������������������������������������������� 44
Creating Your First Generator������������������������������������������������������������������������������������������������������ 45
Yeoman Generators Are Node Modules��������������������������������������������������������������������������������� 46
Sub-generators���������������������������������������������������������������������������������������������������������������������� 47
Defining Secondary Commands�������������������������������������������������������������������������������������������� 55
Composability������������������������������������������������������������������������������������������������������������������������ 57
Summary������������������������������������������������������������������������������������������������������������������������������������ 59
Related Resources����������������������������������������������������������������������������������������������������������������� 59

Chapter 3: PM2������������������������������������������������������������������������������������������������������� 61


Installation���������������������������������������������������������������������������������������������������������������������������������� 61
Working with Processes������������������������������������������������������������������������������������������������������������� 62
Recovering from Errors��������������������������������������������������������������������������������������������������������� 65
Responding to File Changes�������������������������������������������������������������������������������������������������� 67
Monitoring Logs�������������������������������������������������������������������������������������������������������������������������� 68
Monitoring Resource Usage�������������������������������������������������������������������������������������������������������� 70
Monitoring Local Resources�������������������������������������������������������������������������������������������������� 70
Monitoring Remote Resources���������������������������������������������������������������������������������������������� 71

vi
Table of Contents

Advanced Process Management������������������������������������������������������������������������������������������������� 75


JSON Application Declarations���������������������������������������������������������������������������������������������� 75
Load Balancing Across Multiple Processors������������������������������������������������������������������������������� 81
Zero Downtime Deployments������������������������������������������������������������������������������������������������ 84
Summary������������������������������������������������������������������������������������������������������������������������������������ 87
Related Resources���������������������������������������������������������������������������������������������������������������������� 87

Part II: Module Loaders�������������������������������������������������������������������������������� 89


Chapter 4: RequireJS���������������������������������������������������������������������������������������������� 91
Running the Examples���������������������������������������������������������������������������������������������������������������� 93
Working with RequireJS�������������������������������������������������������������������������������������������������������������� 94
Installation����������������������������������������������������������������������������������������������������������������������������� 94
Configuration������������������������������������������������������������������������������������������������������������������������� 95
Application Modules and Dependencies������������������������������������������������������������������������������� 99
Paths and Aliases���������������������������������������������������������������������������������������������������������������� 104
Shims���������������������������������������������������������������������������������������������������������������������������������� 108
Loader Plugins��������������������������������������������������������������������������������������������������������������������� 114
Cache Busting��������������������������������������������������������������������������������������������������������������������� 124
RequireJS Optimizer����������������������������������������������������������������������������������������������������������������� 126
Configuring r.js�������������������������������������������������������������������������������������������������������������������� 126
Running the r.js Command�������������������������������������������������������������������������������������������������� 128
Summary���������������������������������������������������������������������������������������������������������������������������������� 131

Chapter 5: Browserify������������������������������������������������������������������������������������������� 133


The AMD API vs. CommonJS����������������������������������������������������������������������������������������������������� 134
Installing Browserify����������������������������������������������������������������������������������������������������������������� 135
Creating Your First Bundle�������������������������������������������������������������������������������������������������������� 136
Visualizing the Dependency Tree���������������������������������������������������������������������������������������������� 138
Creating New Bundles As Changes Occur��������������������������������������������������������������������������������� 139
Watching for File Changes with Grunt��������������������������������������������������������������������������������� 139
Watching for File Changes with Watchify���������������������������������������������������������������������������� 140

vii
Table of Contents

Using Multiple Bundles������������������������������������������������������������������������������������������������������������� 142


The Node Way��������������������������������������������������������������������������������������������������������������������������� 147
Module Resolution and the NODE_PATH Environment Variable������������������������������������������� 147
Dependency Management��������������������������������������������������������������������������������������������������� 152
Defining Browser-Specific Modules������������������������������������������������������������������������������������������ 153
Extending Browserify with Transforms������������������������������������������������������������������������������������� 155
brfs�������������������������������������������������������������������������������������������������������������������������������������� 155
folderify������������������������������������������������������������������������������������������������������������������������������� 156
bulkify���������������������������������������������������������������������������������������������������������������������������������� 157
Browserify-Shim������������������������������������������������������������������������������������������������������������������ 158
Summary���������������������������������������������������������������������������������������������������������������������������������� 160
Related Resources�������������������������������������������������������������������������������������������������������������������� 160

Part III: Client-Side Frameworks���������������������������������������������������������������� 161


Chapter 6: Knockout��������������������������������������������������������������������������������������������� 163
Views, Models, and View Models���������������������������������������������������������������������������������������������� 164
The Recipe List�������������������������������������������������������������������������������������������������������������������� 167
Recipe Details���������������������������������������������������������������������������������������������������������������������� 171
Binding View Models to the DOM���������������������������������������������������������������������������������������������� 175
View Models and Forms������������������������������������������������������������������������������������������������������������ 177
Switching to “Edit” Mode���������������������������������������������������������������������������������������������������� 178
Changing the Recipe Title��������������������������������������������������������������������������������������������������������� 182
Updating Recipe Servings and Cooking Time��������������������������������������������������������������������������� 183
Adding and Removing Ingredients�������������������������������������������������������������������������������������������� 187
Instructions������������������������������������������������������������������������������������������������������������������������������� 193
Citation�������������������������������������������������������������������������������������������������������������������������������������� 195
Custom Components����������������������������������������������������������������������������������������������������������������� 196
The Input List View Model��������������������������������������������������������������������������������������������������� 197
The Input List Template������������������������������������������������������������������������������������������������������� 199
Registering the Input List Tag���������������������������������������������������������������������������������������������� 201

viii
Table of Contents

Subscribables: Cheap Messaging��������������������������������������������������������������������������������������������� 204


Summary���������������������������������������������������������������������������������������������������������������������������������� 208
Resources��������������������������������������������������������������������������������������������������������������������������������� 208

Chapter 7: Angular����������������������������������������������������������������������������������������������� 209


Differences Between Angular and AngularJS��������������������������������������������������������������������������� 209
Getting Started with Angular����������������������������������������������������������������������������������������������������� 211
Installation��������������������������������������������������������������������������������������������������������������������������� 211
Creating a Workspace in Angular���������������������������������������������������������������������������������������� 213
Directory Structure�������������������������������������������������������������������������������������������������������������� 215
Serving the App������������������������������������������������������������������������������������������������������������������� 216
Customizing the App������������������������������������������������������������������������������������������������������������ 217
Dependency Injection in Angular���������������������������������������������������������������������������������������������� 221
Creating and Registering an Injection Service�������������������������������������������������������������������� 222
Conclusion�������������������������������������������������������������������������������������������������������������������������������� 223

Part IV: Server-Side Frameworks��������������������������������������������������������������� 225


Chapter 8: Kraken������������������������������������������������������������������������������������������������� 227
Environment-Aware Configuration�������������������������������������������������������������������������������������������� 229
Shortstop Handlers�������������������������������������������������������������������������������������������������������������� 234
Configuration-Based Middleware Registration������������������������������������������������������������������������� 239
Event Notifications�������������������������������������������������������������������������������������������������������������� 243
Structured Route Registration��������������������������������������������������������������������������������������������������� 244
Index Configuration������������������������������������������������������������������������������������������������������������� 245
Directory Configuration������������������������������������������������������������������������������������������������������� 247
Routes Configuration����������������������������������������������������������������������������������������������������������� 249
Dust Templates������������������������������������������������������������������������������������������������������������������������� 251
Context and References������������������������������������������������������������������������������������������������������ 252
Sections������������������������������������������������������������������������������������������������������������������������������� 256
Iteration������������������������������������������������������������������������������������������������������������������������������� 256
Conditionality����������������������������������������������������������������������������������������������������������������������� 258
Partials�������������������������������������������������������������������������������������������������������������������������������� 259

ix
Table of Contents

Blocks���������������������������������������������������������������������������������������������������������������������������������� 261
Filters���������������������������������������������������������������������������������������������������������������������������������� 262
Context Helpers������������������������������������������������������������������������������������������������������������������� 264
Dust Helpers������������������������������������������������������������������������������������������������������������������������ 275
Let’s Get Kraken������������������������������������������������������������������������������������������������������������������ 281
Summary���������������������������������������������������������������������������������������������������������������������������������� 306
Related Resources�������������������������������������������������������������������������������������������������������������������� 306

Part V: Managing Database Interaction������������������������������������������������������ 307


Chapter 9: Mongoose�������������������������������������������������������������������������������������������� 309
Basic MongoDB Concepts��������������������������������������������������������������������������������������������������������� 309
A Simple Mongoose Example���������������������������������������������������������������������������������������������������� 314
Creating a Mongoose Schema for JSON Data��������������������������������������������������������������������� 314
Importing Data with Mongoose������������������������������������������������������������������������������������������� 317
Querying Data with Mongoose�������������������������������������������������������������������������������������������� 320
Working with Schemas������������������������������������������������������������������������������������������������������������� 323
Data Types��������������������������������������������������������������������������������������������������������������������������� 323
Nested Schemas������������������������������������������������������������������������������������������������������������������ 325
Default Property Values������������������������������������������������������������������������������������������������������� 326
Required Properties������������������������������������������������������������������������������������������������������������� 327
Secondary Indexes�������������������������������������������������������������������������������������������������������������� 328
Schema Validation��������������������������������������������������������������������������������������������������������������� 329
Schema References������������������������������������������������������������������������������������������������������������ 334
Schema Middleware������������������������������������������������������������������������������������������������������������ 340
Working with Models and Documents�������������������������������������������������������������������������������������� 343
Document Instance Methods����������������������������������������������������������������������������������������������� 347
Document Virtuals��������������������������������������������������������������������������������������������������������������� 350
Static Model Methods���������������������������������������������������������������������������������������������������������� 352
Working with Queries���������������������������������������������������������������������������������������������������������������� 354
Model.find( )������������������������������������������������������������������������������������������������������������������������� 355
Model.findById( )������������������������������������������������������������������������������������������������������������������ 357
Model.findByIdAndUpdate( )������������������������������������������������������������������������������������������������ 360
x
Table of Contents

Model.findByIdAndRemove( )����������������������������������������������������������������������������������������������� 361


Model.count( )���������������������������������������������������������������������������������������������������������������������� 362
Query.Populate( )������������������������������������������������������������������������������������������������������������������ 363
Finding Documents with Query Operators��������������������������������������������������������������������������� 365
Summary���������������������������������������������������������������������������������������������������������������������������������� 375

Chapter 10: Knex and Bookshelf�������������������������������������������������������������������������� 377


Knex������������������������������������������������������������������������������������������������������������������������������������������ 378
Installing the Command-Line Utility������������������������������������������������������������������������������������ 379
Adding Knex to Your Project������������������������������������������������������������������������������������������������ 379
Configuring Knex����������������������������������������������������������������������������������������������������������������� 380
The SQL Query Builder�������������������������������������������������������������������������������������������������������� 381
Migration Scripts����������������������������������������������������������������������������������������������������������������� 392
Seed Scripts������������������������������������������������������������������������������������������������������������������������ 398
Bookshelf���������������������������������������������������������������������������������������������������������������������������������� 400
What Is Object-Relational Mapping?����������������������������������������������������������������������������������� 401
Creating Your First Bookshelf Model����������������������������������������������������������������������������������� 402
Relationships����������������������������������������������������������������������������������������������������������������������� 413
Summary���������������������������������������������������������������������������������������������������������������������������������� 426
Related Resources�������������������������������������������������������������������������������������������������������������������� 426

Part VI: Managing Control Flow������������������������������������������������������������������ 427


Chapter 11: Async.js��������������������������������������������������������������������������������������������� 429
Sequential Flow������������������������������������������������������������������������������������������������������������������������ 431
Parallel Flow����������������������������������������������������������������������������������������������������������������������������� 434
Pipeline Flow����������������������������������������������������������������������������������������������������������������������������� 437
Reusing a Pipeline��������������������������������������������������������������������������������������������������������������� 440
Loop Flow���������������������������������������������������������������������������������������������������������������������������������� 443
Looping While Some Condition Remains True��������������������������������������������������������������������� 443
Looping Until Some Condition Becomes False�������������������������������������������������������������������� 446
Retry Loops������������������������������������������������������������������������������������������������������������������������� 449
Infinite Loops����������������������������������������������������������������������������������������������������������������������� 451

xi
Table of Contents

Batch Flow�������������������������������������������������������������������������������������������������������������������������������� 452


Asynchronous Queue����������������������������������������������������������������������������������������������������������� 453
Asynchronous Cargo������������������������������������������������������������������������������������������������������������ 455
Summary���������������������������������������������������������������������������������������������������������������������������������� 458

Part VII: Further Useful Libraries���������������������������������������������������������������� 461


Chapter 12: Underscore and Lodash��������������������������������������������������������������������� 463
Installation and Usage��������������������������������������������������������������������������������������������������������������� 465
Aggregation and Indexing��������������������������������������������������������������������������������������������������������� 466
countBy()����������������������������������������������������������������������������������������������������������������������������� 467
groupBy()����������������������������������������������������������������������������������������������������������������������������� 468
indexBy()������������������������������������������������������������������������������������������������������������������������������ 470
Being Choosy���������������������������������������������������������������������������������������������������������������������������� 472
Selecting Data from Collections������������������������������������������������������������������������������������������ 472
Selecting Data from Objects������������������������������������������������������������������������������������������������ 475
Chaining������������������������������������������������������������������������������������������������������������������������������������ 481
Function Timing������������������������������������������������������������������������������������������������������������������������ 485
defer()���������������������������������������������������������������������������������������������������������������������������������� 486
debounce()��������������������������������������������������������������������������������������������������������������������������� 488
throttle()������������������������������������������������������������������������������������������������������������������������������� 490
Templates���������������������������������������������������������������������������������������������������������������������������������� 493
Loops and Other Arbitrary JavaScript in Templates������������������������������������������������������������� 495
Living Without Gator Tags���������������������������������������������������������������������������������������������������� 497
Accessing the Data Object Within a Template��������������������������������������������������������������������� 499
Default Template Data��������������������������������������������������������������������������������������������������������� 501
Summary���������������������������������������������������������������������������������������������������������������������������������� 503
Related Resources�������������������������������������������������������������������������������������������������������������������� 503

xii
Table of Contents

Part VIII: Front-End Development��������������������������������������������������������������� 505


Chapter 13: React������������������������������������������������������������������������������������������������� 507
React Overview������������������������������������������������������������������������������������������������������������������������� 507
What Makes React Special?������������������������������������������������������������������������������������������������ 508
Getting Started with React�������������������������������������������������������������������������������������������������������� 509
How to Add React to Web Pages?���������������������������������������������������������������������������������������� 509
Installation��������������������������������������������������������������������������������������������������������������������������� 510
Building a To-Do Application����������������������������������������������������������������������������������������������������� 514
Summary���������������������������������������������������������������������������������������������������������������������������������� 520

Chapter 14: Vue.js������������������������������������������������������������������������������������������������ 523


Vue.js Overview������������������������������������������������������������������������������������������������������������������������� 523
What Is Vue.js?�������������������������������������������������������������������������������������������������������������������� 523
What Is Vue Meant For?������������������������������������������������������������������������������������������������������� 524
Getting Started with Vue.js�������������������������������������������������������������������������������������������������������� 526
Installation��������������������������������������������������������������������������������������������������������������������������� 526
Building Our First Vue App��������������������������������������������������������������������������������������������������� 528
Digging Deeper������������������������������������������������������������������������������������������������������������������������� 532
Directory Structure�������������������������������������������������������������������������������������������������������������� 532
src/main.js File�������������������������������������������������������������������������������������������������������������������� 533
src/App.vue File������������������������������������������������������������������������������������������������������������������� 534
components/HelloWorld.vue File����������������������������������������������������������������������������������������� 535
public/index.html File���������������������������������������������������������������������������������������������������������� 538
Summary���������������������������������������������������������������������������������������������������������������������������������� 539
Next Steps��������������������������������������������������������������������������������������������������������������������������� 539

Index��������������������������������������������������������������������������������������������������������������������� 541

xiii
About the Authors
Sufyan bin Uzayr is a web developer with over 10 years of
experience in the industry. He specializes in a wide variety
of technologies, including JavaScript, WordPress, Drupal,
PHP, and UNIX/Linux shell and server management, and
is the author of five previous books. Sufyan is the Director
of Parakozm, a multinational design and development
consultancy firm that offers customized solutions to a
global clientele. He is also the CTO at Samurai Servers, a
server management and security company catering mainly
to enterprise-scale audience. He takes a keen interest in
technology, politics, literature, history, and sports, and in
his spare time he enjoys teaching coding and English to students. Read more about his
works at www.sufyanism.com.

Nicholas Cloud is a software developer who lives in the very


humid city of St. Louis. For over a decade, he has forged
his skills into a successful career. He has developed web
applications, web services, and desktop software on diverse
platforms with JavaScript, C#, and PHP. A strong proponent
of open source software, Nicholas contributes to userland
projects and has written several of his own open source
libraries. He speaks at a variety of user groups and conferences
and writes books, technical articles, and blog posts in his spare
time. He opines on Twitter at @nicholascloud.

xv
About the Authors

Tim Ambler is a software engineer from Nashville,


Tennessee. His passion for programming follows in the
footsteps of his father, who introduced him to computers at a
young age with a Commodore 64. Tim is the author of several
popular open source projects, one of which (whenLive) has
been featured by GitHub’s staff. An occasional conference
speaker and frequent writer, Tim has been referenced
multiple times in online publications such as JavaScript
Weekly and Node Weekly. He currently lives in the 12 South
area with his wife, Laura, and two cats. You can follow him
on Twitter at @tkambler.

xvi
Another random document with
no related content on Scribd:
Diane faced her passionately.
“How can you, Fanny? How can you pity him more than I do? I loved
him!”
“Yes, I know; but when you knew what he’d done, you ceased to
love him. Wasn’t that it, Di? You see I—I suppose I’m a weaker
mortal. I couldn’t do that. I should keep on loving him—well, just
because I should feel he needed it so much!”
“Would you?” Diane came slowly nearer, looking at her friend
imploringly, her face colorless. “Fanny, do you think that’s it? That’s
what I’ve asked myself a hundred times. Do you think I—I never
really loved him?”
“Oh, that’s too much to say! I couldn’t judge for you, Di, we’re—
we’re so different. I suppose I’m like—like the dog that keeps going
back to lick the hand that’s struck him. If I loved any one, I couldn’t
—I simply couldn’t turn on them like that!”
“I didn’t think I could, either; but when he told me what he’d done—
Fanny, I can’t tell you how I felt. I felt as if something had died in
my heart. I couldn’t even look at him again without seeing him in
flight and—and Overton alone, deserted in the snow and ice, left to
die!” She covered her face with her hands, shuddering. “I could have
forgiven him a sin against myself far more easily. I could have
forgiven even dishonesty, but that—Fanny, I—I couldn’t, I can’t!”
Fanny averted her eyes. The response that rose to her lips was too
pertinent.
“It’s because you always loved Overton!” she longed to cry out.
Instead, she rose and put her arms around Diane. “If you feel like
that, dear,” she said, “there’s only one way out.”
Diane clung to her trembling.
“You mean——”
“Your father’s way,” Fanny said firmly. “Papa told us the judge meant
to get a divorce for you.”
Diane held her, looking into her eyes. The two seemed to have
suddenly changed places; Fanny was the more composed and
confident now.
“Then you—you don’t think it would be wrong?” Diane implored.
Fanny shook her head.
“I think it’s better than to feel as you do. I know mama’s fearfully
opposed to divorce, and papa is, of course. But, no, Di, I think it
would be right for you—and for him, too.”
Diane’s hands fell from Fanny’s shoulders, and she walked slowly
over to the window and stood looking out. For a while they were
both silent. Fanny felt that instead of reassuring her friend, she had
only added to her distress. Through her very words of
encouragement Diane must have felt the subtle suggestion of
Fanny’s mind—her belief that Diane’s love for Overton made her
marriage not only intolerable but impossible.
She was conscious, too, that her own emotion dictated her pity for
Faunce, that even now she could not quite forget the hold he had
always had upon her mind and heart. She was flushed and
tremulous when Diane turned suddenly and kissed her.
“Good-by, dear,” she said softly. “I can’t stay here now and face your
father. I know what he’d think. Oh, Fanny, I—I wish I had never
been born!”
The two girls clung to each other for another moment, neither of
them quite able to be coherent. Then Diane ran down-stairs and
made her way out into the rain.
XXXI
It seemed to Diane that her emotion, like the storm, had nearly
spent itself, and the few fresh rain-drops that fell on her face helped
to cool its feverishness, just as a sudden revival of pride and
strength helped to quiet the tumult within.
Torn by conflicting emotions, she had stretched out blindly for
guidance—or, at least, for some sort of sympathy that would steady
her purpose and point a way in the maze. Fanny had furnished it,
not so much by what she had said as by what she left unsaid; and
Diane felt the sting of mortification at her own weakness. She had
gone out like a mendicant asking the alms of sympathy, and she had
received not bread, but a stone.
Suddenly, too, she perceived a fact that had long been only a vague
idea in the back of her mind. Fanny had been fond of Faunce! She
saw it plainly now, with a passionate feeling of rebellion. If love
awaited him elsewhere, why had fate delivered him into her hands?
It was all confused, all at cross-purposes.
If he had married Fanny, there would, perhaps, have been no
question of his confession. Fanny would have helped him where she
had failed. That was the cruelty of it—a cruelty that involved him as
well as herself. Why had he been so blind? she cried angrily to
herself. Why had he passed Fanny by to pursue her? If he had only
left her alone—
She stopped short and stood still. Again she saw herself going over
the edge of the abyss. She tried to steady herself, to find the guiding
light, the lamp to show her the way out.
Then, just at the very moment when she was least able to endure it,
least able to battle any longer, she saw Overton himself just ahead
of her. He was walking fast. As he turned he caught sight of her,
and, swinging around, came rapidly toward her, his face as white as
hers was red with embarrassment.
As he drew nearer, she stopped, more because she did not know
what else to do than from any wish to see him. Her first impulse,
indeed, had been one of flight, and she suspended it only because,
in the hedged lane, there was no convenient way to flee. Something
of what she felt—her trepidation, which almost amounted to sheer
fright—showed in her eyes and her reluctant attitude, and he saw it.
He halted a few yards away and stood looking at her.
“You don’t wish to see me?”
The note of pain in his voice sent a thrill of answering pain through
her heart. Unconsciously she held out her hand.
“I do—only it’s hard—after all I’ve been told!”
Her broken words touched him deeply. He realized that she felt a
vicarious share in her husband’s guilt toward him, and he caught her
hand in both of his.
“He should never have told you. I tried to save you that!” he
exclaimed.
She drew her hand gently away.
“You did wrong, then. He was right to tell me—I had to know.”
“But why?”
He had turned with her, and they walked on through the light rain.
She looked up, her mind clearing.
“It was wrong of you to urge silence on him. If he’s ever to be
anything, he mustn’t be silent. A thing like that must be confessed
and atoned for. Besides, he knew that I should know in the end. I
couldn’t help it. I’ve felt that there was something wrong, something
terrible behind it all!”
“And it has made you wretched—I see that. Why can’t you forget it?
I should never have come back. It’s I who have ruined your
happiness.”
“Oh, no, no! Think how infinitely worse it would have been if you
had perished and I had known too late that he—that he had left
you! I couldn’t have borne that.”
The passion of her tone moved him again, and for a moment he did
not reply. He was keenly aware of her presence at his side, her
delicate profile against the light mist that was rising like vapor about
them, the curve of her brow and the oval of her pale cheek under
the dusky sweep of the brown hair that waved upward under her
wide hat, the meticulous simplicity of her dark dress, her grace and
slightness.
She seemed so young, so girlish, and she was facing a situation so
tragic and humiliating! Overton was himself a proud man, and he felt
her humiliation, felt that he must lighten it.
“I’ve wanted to speak to you about this,” he managed to say at last.
“You mustn’t think that he did something do unpardonable. It isn’t
unpardonable to any one who’s ever been at the pole. No man has a
right to expect too much from his fellows there, and”—he hesitated
—“when a man drops behind, why, he’s got to perish. The stakes are
too great, the price too much, to lose all for one life. I fell in my
tracks, and it’s only fair to him to think that I should have stayed
where I dropped. The expedition couldn’t be imperiled just for me. I
wasn’t worth so much. He did what—well, what nine out of ten
would have done in his place.”
She stopped and faced him, her large eyes dark with emotion.
“Did you leave Rayburn?”
He flushed under her eyes.
“That was different. Faunce was with me—there were three of us. It
was different, of course.”
“I can’t see the difference.”
“It was different, though. Besides, there was no blizzard impending.
In my case the storm made it doubly perilous to stay.”
“It made the going worse!” she retorted in a hard voice.
He turned his head, and their eyes met; he felt almost as keen a
shame as if he, and not Faunce, had done this thing. He saw that to
her it was unpardonable. She would never see any reason or excuse
for it. If she had loved her husband, then Overton’s return had
wrecked her life.
“I’ve made you wretched!” he exclaimed with profound emotion. “It’s
come to me again and again, since my return, that it must be
dreadful for a man to come back from the dead. When we die—or
people think we’re dead—our places close over our graves; there’s
no niche left for us any more. To come back is to disrupt the
tranquillity of the life that’s begun to flow in new courses over the
surface of the grave. That’s what I’ve done—I’ve come back and
wrecked your happiness!”
She shook her head vehemently, tears rising in her eyes.
“No, I never had it. I know now I only imagined. I never had any
happiness at all!”
“Diane!”
Her cry had gone to his heart. It was more than he could bear. He
caught her hands in his again and held them.
“Don’t say that, for I can’t bear it—no man who loved you could
bear to hear you say that!”
She did not answer him, but stood still, her hand quivering in his
grasp. They were alone under the trees, and the sun, breaking
suddenly through the clouds again, illumined the moist atmosphere
until it seemed shot with golden motes.
“I’ve no right to say it,” he went on passionately; “but I’m human,
and I can’t keep silence! Diane, I’d rather have died down there in
the ice and snow, where he left me, than to have come back to lose
you!”
Still she said nothing, but her head drooped, and she could no
longer look up. She knew now why she had left her husband. Her
whole subconscious being cried out:
“It was this—this! You loved this man, and not your husband!”
“I’ve always loved you, Diane!” he went on madly. The restraint he
had set on himself had broken, and nothing now could stem the
current of his emotion. “I loved you before I went away, but I wasn’t
sure of you; I didn’t dare to risk too much. Diane, if I had spoken
then, would you have listened, would all this have been saved?”
She broke down herself.
“Don’t ask me—don’t—it’s no use! It’s done—don’t you see it’s no
use to ask me now?”
“It’s not done, if you’ve left him! Your father says you’ve left him. If
you have, if you’re going to be free, Diane, it’s not wrong for me to
speak. I can’t be silent; I’m human. I’m as bad as he is—I’m worse,
for you’re his wife. But I——” He stopped, and then went on in a low
voice: “Will you answer me, Diane, just one word. Did you then—
before I went away—did you care?”
She looked up into his face and saw it transfigured with deep
emotion—the face of the man she loved, for whom she had left her
husband. She was trembling, but his eyes held hers, and she
yielded.
“Yes!” she sobbed below her breath.
They swayed toward each other in the golden mist, he holding her
hands in a grip that thrilled with passionate hope.
“Diane, my love!” he cried.
If she heard him, she did not answer, though she closed her eyes
and her lips moved. He seemed to feel, through the impalpable veil
between their two souls, that hers was struggling away from his and
trying to rise by its own agony to a supreme height of renunciation.
But he would not let her go.
“Then—then, if you cared once, you care—you must care again. I
can’t have you speak as you did just now—about there being no
happiness for you. I can’t bear that, for I’d give all that I have, the
best that’s in me, to make you happy. Speak to me! It’s not wrong—
I know what you think, but it’s not wrong if you’re going to begin life
over again. It’s not wrong for me to try to win you again, to make
you happy!”
With a sudden effort she dragged her hands from his and moved on
blindly, hurrying away from him.
“Don’t!” she sobbed. “Don’t make it worse. It’s all wrong; I know it;
I see it; I—I left him because——”
He had caught up with her now and walked beside her, as pale as
she was.
“Because what? Tell me; I must know; I have a right to know!”
She staggered again; her hand going to her throat with a strange
little gesture, as if she felt strangled.
“Because I loved you! I see it now—and it’s wicked. I hadn’t any
right to judge him, for I was worse than he was. It’s one of those
things that make it wrong, Simon—that make it wrong even to have
cared once!”
“No, it’s not wrong! We’ll get you free. He—I’ll say it now, Diane—he
had no right to marry you!”
“I was the one who did wrong—as much as he did,” she managed to
say. “I—I thought I loved him; I told him I loved him. I must have. If
I didn’t, I—I could never have married him!”
“But you were mistaken! That’s common; it happens often. You were
mistaken—you didn’t love him!”
She stopped again, and the misty sunlight illumined her face until it
appeared to him to have a purity as luminous and fragile as an
alabaster lamp. Her spirit, tried beyond endurance, seemed to be
shining through it, darkening her eyes and softening her lips.
“Oh, I’m not sure!” she cried. “Don’t you see how I feel? There are
two roads, and I stand at the crossing. I’m bewildered; I can’t see; I
can only feel——”
“But I know!” he returned with profound emotion. “I know! My love
is strong enough to find the way for us both. It’s not wrong to love
you, for you’ve given him up!”
For a moment, as she clung to him, he felt the slight weight of her
body against him, the fragrance of her hair upon his cheek. Then
she had slipped out of his arms and left him alone in the mist.
XXXII
In a tumult of feeling deeper and more complex than ever, Diane
made her way through a meadow that furnished a short cut to her
own door. She was vaguely aware that the grass was long, and that
she was getting drenched nearly to her knees, when she saw, in a
half-conscious way, a cluster of asters blooming happily just at the
spot where a lowered fence-rail made it possible for her to scramble
into the end of her father’s garden.
She was scarcely conscious of what she did, and she had a new
feeling of guilt. Until now she had felt that she was as supremely in
the right as Faunce was supremely in the wrong; but the whole
attitude of her mind was breaking down. She felt a tremor of fear,
though even at that moment she could not have told what it was
she feared.
Shaken as she was, she tried to let herself in without attracting
attention, for she had as little courage as ever for an interview with
the judge. However, she was not to escape. He heard the rear door
open, and, looking out of his library, espied her at the foot of the
stairs.
“Is that you, my child?” he said in the deep bass that always
presaged something important. “Come in here a moment before you
go up-stairs. I have something to tell you.”
She turned reluctantly and followed him into the old room, which
was so full of memories that it made her shiver. Her father resumed
his seat by the table, but she remained standing just inside the door,
where a bit of sunshine from the window touched the edge of her
wet skirt, but left her face in shadow. The judge mounted his
spectacles and looked over some papers, refreshing his memory.
“My dear, of course we’ll employ counsel; you know that! I’ve just
got a letter from Holt and Hickson, which seems satisfactory on the
whole. Mr. Hickson—he’s the junior partner—advises us to wait until
the expedition sails. He’s seen Faunce, and, as far as he can
ascertain, there’ll be no opposition. Faunce has modified his first
assurance to me a little, but I suppose we’ll have to expect that—to
expect changes and vacillations in a man like him!”
Diane tried to steady her voice.
“What did he say—I mean, what does he say now, papa?”
The judge consulted the letter again.
“He told Hickson that it depended upon you. He has the greatest
faith in you, and won’t oppose divorce if you ask it; but he wants
you to ask it in writing. It’s absurd—knowing, as he does, that
you’ve left him; but he seems determined, so Hickson says, to know
just what you want. Of course, if that is really all he wants to know,
it’s easy. You can make a statement here; I’ll have it typed and
witnessed, and Hickson can let him see it.”
“And if I didn’t want to write anything, what would happen then?”
Her father looked up in amazement.
“Not want to write anything? Of course you do! The sooner you’re
free of that—that coward the better. That’s what I called you in for.
You can decide just what you want to say, and I’ll have it prepared
for your signature.”
She lifted her head at that, looking at him, a singular expression on
her face.
“But that’s just it. I—I can’t! You see, I don’t know what I want to
say at all.”
Her father suppressed an exclamation of impatience.
“I should think you’d know well enough! You’ve got to say
something, or else let it go, and after a while he’ll sue you for
desertion; but no one knows how long it would take him to get his
courage screwed up to that. I wish”—the judge let his hand fall
heavily on the papers before him—“I wish we had a clean case
against him to sue on at once.”
“You mean—we haven’t any case?”
He frowned.
“We’ve got case enough, in one way; but against you—well, he’s
done nothing against you but to dare to marry you, knowing what a
coward he was!”
Diane continued to look at him, her eyes dilating a little, but she was
silent. The judge, aware of it, looked up and encountered her
expression. He pulled off his spectacles and gazed at her steadily.
“What’s the matter, Di? You look ill—I’ll have to send for Gerry.”
“Oh, no! It’s nothing but the scent of those tuberoses on the table—
it’s so strong, it makes me feel faint.”
She moved away as she spoke and put herself a little out of the
range of his vision. The judge took the glass of tuberoses and set it
on the window-ledge.
“I thought you had a craze for all kinds of weeds. This thing has
been too much for you; that’s what’s the matter.”
“No, no!” she gasped weakly. “I’m strong enough to stand a great
deal more than this. I——” She hesitated, beginning to walk about
on the other side of the room, her figure outlined against the rich
bookbindings, but her face still in shadow. “Papa, what would you
say if I—if I decided to go back to my husband?”
There was a sharp little pause before the judge’s bass boomed
across the table.
“I’d disown you! A woman that could go back to such a coward
wouldn’t deserve recognition.”
She laughed hysterically.
“But I married him!”
“You didn’t know it, did you?”
“You know I didn’t.”
“Nor did I!” The judge controlled his anger. “I beg your pardon, Di,
for my share in it. Gerry thinks I helped make the match. If I did, I’ll
help unmake it. I’ll have a statement drawn up for you, and you’ll
only need to sign it. I should hate to feel the marriage was my fault.”
“It’s no one’s fault—unless it’s mine. I—I had no right to think I
loved him if—if I didn’t!”
“You didn’t—that’s it, my child. Mistakes like that make half the
marriages. I’ve seen enough of it in my day, and I don’t mean to
have your life ruined at the start. You’re getting hysterical, that’s all.
I’ll see that you get out of it and have a chance to make your life
over. You can trust me for that, my girl!”
“But if—if I shouldn’t feel that I wanted to—to have you do it,
papa?”
He turned sharply.
“What’s the matter? Have you seen that fellow?”
“My husband? Oh, no, no!” Her face flushed painfully. “I don’t
believe he wants to see me after the way I left him.”
The judge started to retort, but hesitated and reflected. He had
been on the point of telling her that Faunce did want to see her, but
he thought better of it.
“It was enough to cure him—I’ll admit that, my dear,” he finally
replied.
Diane moved to the nearest cabinet, and lifting a little jar of ancient
pottery, began to examine it as if she had never seen it before.
“Do you think that any one—that any woman who’s been through
what I’ve been through can start over again!”
“Of course she can! Why not? A man can fail and fall, for that
matter, and then get up and start fresh.”
“Oh, but that’s different; the man’s not the question. I’m a woman.
It’s not the same thing at all!”
“You’re getting back now to the fundamental question—the double
standard of morals. It’s not relevant. You’re not doing anything
immoral to refuse to live with a coward.”
“I didn’t even stop to think!” she cried. “When he told me what he’d
done, I”—she shuddered—“I couldn’t stay!”
“Of course you couldn’t! What’s more, I won’t let you go back to
him. You understand that, Di? You’re nervous and broken down, and
he may try to persuade you, but I’ll never let you go back!”
“But if—if I went, papa?”
He struck his hand down on the table.
“Understand me. If you went I’d never speak to you again as long as
I lived! Don’t you see what he did? He wasn’t only a coward; he
would have been Overton’s murderer if the English party hadn’t
come along. It was a miracle that saved Overton; Faunce as good as
left him purposely to die.”
“Yet”—she spoke with an effort—“yet Overton doesn’t blame him as
you do. He tries to excuse him.”
“You’ve seen Overton?”
“Ye-es; just now. I met him on the way home,” she stammered.
A look of relief softened the judge’s face. He rose from his chair and,
crossing the room, took his daughter in his arms.
“My child, you’re half sick! You’ve worried too much. Don’t talk in
this way again. You know you long to be free.”
His softened tone disarmed her again. She clung to him, trembling,
tears in her eyes.
“Oh, I do—I do!” she sobbed. “I long to be my old self again!”
The judge gathered her up in his arms, as he had often gathered her
up as a child, and carried her up-stairs to her room. He put her on
the lounge and covered her up; then he went down, and sent the
old maid servant up with a cup of hot tea. It was the only thing he
could think of that seemed to fill the peculiar demands of a case like
this—a case which, to his mind, was nothing but hysteria. Then he
set himself to framing the reply to Faunce that Diane was to sign.
He had made up his mind to settle her affairs for her. He was
convinced now that she loved Overton. Sternly as he might have
viewed such a case where others were involved, he could see only
one side of it for his own daughter—her right, the inalienable right of
youth and love, to happiness. He did not permit the finer and more
ethical questions to disturb his fixed determination to wrest her from
the craven who had been capable of a crime as near to murder as
anything short of actual killing could be. Indeed, to his own stalwart
mind, it was even worse than murder.
Meanwhile Diane, up-stairs in her own room, drank the hot tea, and
permitted the maid to help her with some dry clothing; but she was
still shaking like a person who had been suddenly smitten with ague.
All the while she seemed to see, through a mist shot with golden
rain-drops, the face of Overton, transfigured with his love for her.
She wrung her hands together and hid her face in them, oblivious of
the pitying eyes of the old servant who had come to take away the
tea-things.
She was still sitting there, with her head in her hands, when she
heard her father leave the library and go out, and knew herself to be
alone in the house. She breathed more freely when she was not in
immediate danger of being rushed into some new and terrible
decision—a decision that might make her as wretched as that other
one which had led to her marriage. She rose weakly from the lounge
and went down-stairs.
It was now late afternoon, and the sun had come out with
extraordinary splendor. It was flooding the western windows and
dappling the lawn with a lovely lacework of rain-gemmed cobwebs
that sparkled like frosted fairy veils.
Diane went slowly across the hall, and saw the evening mail lying on
the little table in the corner. It recalled with a sharp pang the days
long ago when she had looked there in vain for a letter from
Overton, then on his way to the south pole. There were some letters
there now, however, and she turned them over and started violently
when she recognized her husband’s handwriting on an envelope
addressed to her.
For a moment she leaned forward, her hands on the table, unable to
make up her mind to open it. The aversion she had felt at his
confession swept back over her in wave on wave of futile passion
and shame. Then she took up the letter and, opening it, moved to
the window to read more clearly the few lines that he had written in
an unsteady hand:
Your father told me you wanted a divorce, Diane, and now
his lawyers insist upon it; but it’s hard for me to believe it
of you. I know how you felt when you left me, but now—
I’ve done nothing against you, and I trusted you to help
me to do better things. I ask you to come back, I entreat
you to come; but I’ll never try to force you. I have told
them that you must answer me yourself. If you don’t, I
shall refuse to let it go on, for I love you still. I will not
take an answer from any one but you. If you still ask it, I
will set you free. But even then I shall love you.
The letter fell from Diane’s hand and fluttered to the floor. She could
see him as he had looked that night in the cottage; she could hear
his voice making the confession. The letter was like him. It seemed
to fall short; it had not even the courage of his love; and yet she
knew he loved her. His very weakness in this hour, when he so
needed strength, touched her woman’s heart. Her abhorrence of his
deed had clouded her own perception of his misery, but now, in a
flash, she saw it. It was as great as hers.
She was still standing there, her head bowed, when she heard steps
on the piazza and her father’s latch-key in the door. He came in,
bringing with him a young man whom Diane recognized as the
village notary. She stooped quickly, picked up her husband’s letter,
and stood, holding it behind her, as they entered.
The judge looked at her gravely, unable to discern her expression as
she stood with her back to the light.
“That paper’s ready, Diane,” he said briefly, “and Mr. Mackay’s come
with me to witness it. All we need now, my dear, is your signature.”
Diane turned and acknowledged the young man’s bow with a deep
blush. She felt that all the world now knew of her flight from her
husband.
The judge went to the library door and opened it, young Mackay
waiting at a respectful distance. Diane did not move, and her father
looked around.
“Are you ready, my child?” he demanded sharply.
She hesitated an instant, and then turned and followed him into the
room.
He went to his table and spread out a type-written sheet, dipping his
pen in the ink, and holding it ready in one hand, as he pulled out a
chair for Diane with the other.
“Read that, my dear,” he said briefly, “and then sign here.”
His daughter came slowly over to the table and sank into the chair
he offered, drawing the paper toward her. The powerful sunshine in
the room seemed to flood the document with light, and she could
read it at a glance. It was a brief reply to her husband’s demands
and a plain statement of her determination to sue for divorce at
once.
She read it, aware of the impatient hand at her elbow clenching the
pen, and of young Mackay opposite. From the time when she read
her husband’s letter until now she had acted mechanically, scarcely
conscious of what was going on around her; and she was only half
aware of the curiosity and concern in young Mackay’s eyes. She read
the paper slowly through, and then, drawing a long breath, she took
the pen from her father’s hand.
He spoke sharply to the witness:
“Come over here and see her sign it, John!”
The notary obeyed, and they both stood waiting, their eyes on
Diane; but she did not sign the paper. She rose suddenly, turning a
white face toward her father.
“I—I’m sorry, papa, but I really can’t sign it!”
As she spoke she looked up, encountered the amazement and fury
and repudiation in his eyes, and swayed under it—but only for a
moment. She steadied herself, and, turning back again with a
gesture of finality, laid the pen down on the table.
XXXIII
Five minutes later the judge had closed the door behind the young
notary, and stood alone in the hall. He had shut the door sharply,
with almost a bang, but now he stood—with his hand still on the
knob—thinking. His first fury against his daughter was scarcely
subsiding, it had gained force in those moments of mortification—
when he had to dismiss the young man whom he had brought to
witness her signature—and now it rose in a hot wave of anger
against her and against Faunce. He suspected that Faunce had
written to her, he was trying to drag the poor girl back against her
will. And she—Diane Herford, his own daughter—had not the force
of character to resist that craven!
The judge turned with a black brow and tramped back to the library
door.
“Diane,” he said in a voice of thunder, “what do you mean by this?”
She was still standing beside the table, in fact she was clinging to
the edge of it, and her face was deathly pale. She did not move, she
did not even raise her eyes, and her father, still enraged, became
alarmed.
“Did you hear me?” he shouted. “What is it, Diane, are you ill? Are
you mad?”
At that she turned her head, and slowly and reluctantly lifted her
eyes to his.
“I think I’ve been mad, father,” she replied in a low voice, “mad and
wicked.”
The judge came into the room, he moved over to get a nearer look
at her, peering across the table—where the paper still lay, with the
pen flung across the face of it, a mute witness of her indecision, or
her change of heart. Diane did not meet his eyes this time, she
averted her face and her lips trembled.
“You’re ill, that’s what ails you!” her father exclaimed sharply. “I was
a fool not to see it, you’re too hysterical to sign this paper to-day,
I”—he stamped over to the telephone—“I’ll call up Gerry. I ought to
have done it before——”
She stopped him. “Papa!”
He swung around at the sound of her voice, and, for an instant, they
looked at each other. She was trembling, but a little color came back
into her face.
“I’m not ill,” she said slowly, with an effort, “and I’m not mad now.
I’m sorry, papa, I can’t sign it because——” she stopped, her eyes
fell, the color rose softly from chin to brow, her whole face seemed
transformed and softened and strangely beautiful—“because it would
be wrong for me to sign it.”
His eyes sparkled with anger. “Wrong for you to sign it? Do you
mean to tell me that I—your father—would ask you to do anything
wrong?”
“No, no! You don’t understand—I—I can’t tell you, papa, I can’t tell
any one—just what I feel. It’s something a woman can’t tell—I mean
she can’t make any one else understand the change that comes into
her heart and her soul when she’s been tried—as I’ve been tried!”
“Pshaw! Any fool could understand it—you’re hysterical!”
Diane gave him a strange look, a look that was not only appealing, it
was mystical and remote, it seemed to the angry old man that his
daughter’s soul was withdrawing itself into some shadowy region, as
obscure to his robust mind as the mists and the snows that had
enveloped the fatal delinquency of her husband. But the suspicion
that had shot through his mind at the door, came back now with
sudden and convincing force.
“That fellow’s been writing to you!” he exclaimed, “he’s been trying
to make you come back!”
Diane, full of the fresh consciousness of Arthur’s letter, averted her
eyes.
“Yes, he’s written me,” she confessed simply; “he has a right to do
that, he’s—my husband.”
The judge gave utterance to an inarticulate sound. He was, in reality,
choking with anger.
Diane saw it; she felt an almost intolerable longing to escape, to be
alone to order her thoughts, but she could not bear to incur her
father’s anger, he had been so good to her! She had fled to him in
her darkest hour and he had sheltered her. She hated to offend him,
she stood irresolute, unable to voice her thoughts.
Meanwhile, the old man swallowed the lump in his throat.
“I knew it!” he exclaimed bitterly. “He’s been trading on your pity, on
your woman’s heart—confound him! Di, you want to be free, you’ve
said so—why did you mortify me just now? You made that boy think
I was trying to force you to sign a paper against your will. You made
a fool of your father because that—that coward’s been begging off!”
“No, no!” she cried sharply, “it wasn’t that—he’s said nothing
cowardly, papa, nothing that—that he shouldn’t say to his wife. It is
I—I have changed, I——” she stopped, breathing quickly, and then
she added more quietly: “you know what I said, papa—what would
you do if I went back to my husband?”
The judge stood looking at her for a long time in silence, his face
flushing darkly. Then he broke out with passion.
“I’ve told you that, too! I’d disown you.”
She put her hand to her side with a quick gesture of pain, and all
the soft color left her face, even her lips grew white.
“Do you mean that?”
The judge, still regarding her with smouldering eyes, bent his head
slowly.
“I do. I told you so before I got Mackay. I mean it! What did that
fellow write you, what did he say, to make my daughter behave like
this?”
She stood her ground firmly now, though she was still very pale.
“It wasn’t Arthur’s letter, it was—something else.”
“What else?”
The judge’s words snapped like a whip; his rage against Faunce was
deepening to fury now. It was too much to see the power that
coward had to make his daughter wretched. He meant to break it,
he would break it, but first—he must break Diane’s will, he saw that!
“I told you I had seen Overton,” she replied slowly, speaking with an
effort, as if the words were painful. “It was Overton—who made me
see it all, see it so plainly that I couldn’t think why I’d—I’d ever been
blind!”
“Overton?” the judge was bewildered. “Why, the man’s in love with
you, Di!”
She bent her head at that, tears in her eyes.
“I know it,” she spoke so low that her words were almost inaudible,
“that’s why I—I saw it all so plainly. I’m not that kind of a woman!”
“What kind of a woman? What do you mean?” cried the judge with
impatience.
“The kind of woman who leaves her husband to go with another
man.”
“Good Lord!” cried the judge furiously, “you came to me! It’s not
your fault if Overton kept on loving you, is it? You haven’t run away
with Overton, have you?”
“If I signed that paper it—it would be almost the same thing!”
He scowled at her, trying to think, seeing at last one side of the
question which was not his side.
“You mean you left Faunce because you loved Overton?”
“No!” she cried sharply. “But he loves me, he wants me free. If—if I
signed that paper it would be as if I wanted to be free to—to marry
him!”
For the second time that day, the judge thought that he saw the
light; he softened his tone.
“You do love Overton, Di, and you think it’s wrong, so your idea is to
make a martyr of yourself, to refuse a divorce?”
Suddenly her face quivered; an emotion stronger and deeper than
any that he had ever seen in her before, shook her from head to
foot.
“Oh,” she cried brokenly, “don’t ask me, papa, I—I can’t make you
understand, you—you’re a man, you can’t! I—I wish I had a—a
mother!” she sobbed, covering her face with her hands.
The judge was profoundly touched. He felt that his girl was ill in
body and mind, and he had driven her too hard, he had tried to
force her to act before she was ready, he had seemed to fling her
into the arms of her lover. That cry for her mother—he had never
heard her utter it before, it reached his heart. He went over to her
quickly and took her in his arms.
“I’ve been too hasty, my child,” he said kindly. “You must rest—then
we’ll talk it over. You——” he hesitated before he added grimly: “I
know how you feel, but you’re not to blame. Overton has always
loved you. It’s not his fault now, it’s not yours. If you can’t live with
your husband you’ve got a right to be free, and I’m going to set you
free. You leave it to me, Diane!”
This time his tenderness did not disarm her, she did not yield to his
caress, instead she gave him a strange look, a look that was full of
sadness, and slipped quietly out of his arms.
“I—I feel tired,” she said in her low voice, “I can’t argue now, papa, I
——” she turned suddenly and lifted her face to his and kissed him
—“I’m going up to my room to—to think!”
He stood watching her, taken by surprise. She was walking slowly,
almost unsteadily, toward the door and he saw that she was
weeping. Something in the way in which she had parted from him,
something, too, in the whole attitude of her figure, alarmed him. He
called to her sharply.
“Diane!”
She stopped at the door and looked back, her face colorless again,
and tears in her eyes.
“Understand me,” said the judge sternly, “I’ve told you before.
There’s but one thing for you to do—or for me to do for you. To get
free of that coward. If you’re dreaming of going back, if he’s worked
on you to go back—remember! I’ll disown you.”
His tone, more than his words, sent a chill to her heart, but she said
nothing. She only gave him a look so full of a mute appeal, and that
mysticism, that withdrawal, which had so perplexed him a moment
ago, that he could not fathom her purpose. Then, without a word,
she turned slowly and left the room and he heard her step—still slow
but more resolute—ascending the stairs.
He was sorry that he had been so sharp with her, he began to
perceive that the trouble had gone deeper than he thought. Or that
man, Faunce, had worked upon her—the judge’s choler rose up in
his throat again and nearly choked him. He sat down at his table and
tried twice to write a letter to Faunce, a letter that should be a
quietus, and then, thinking better of it, he tore the sheets into
fragments and tossed them into his waste-paper basket.
Meanwhile, Diane, having reached her own room, locked the door
with shaking hands. It seemed to her that she had spent all her
strength in this conflict of wills, that it had cost her much to resist
her father. And yet——?
She recalled the moment when she had lifted the pen, when she had
almost signed that paper, with a shudder. It was true that the whole
attitude of her mind had broken down. She had seen herself on the
brink of separation from her husband because of Overton!
She stood now, just inside her own door, motionless, her unseeing
eyes fixed on the window opposite. The long swaying bough of a
tree swept across her vision of the sky, and it seemed to her that the
leaves trembled and quivered as if some unseen hand had set them
to shaking, as an unseen power had set her own heart to trembling
at the thought of her own act. Had she fled from her husband—not
because she abhorred his deed, but because she loved Overton? The
thought was hideous, unbelievable!
Diane lifted her hot hands and pressed them against her eyes, to
shut out the light. In the darkness she could think. She tried to recall
all the old arguments that had seemed so plausible, that Faunce
himself had destroyed her faith in him, that he had hurled her idol
down from its pedestal. But she could not; she began to see that
there was no argument that she could use to wholly excuse her act.
Faunce had confessed to her, he had told her the truth, it was his
plea for mercy, for forgiveness, and she had only thought of
Overton. But now, in the solitude of her own room, in this moment
when even her father had failed her, she felt her spiritual isolation.
There was no one on earth who could help her solve the problem of
life that confronted her but the man she had married. The bond was
unbroken, neither her will, nor the cribbling of lawyers could break
it, for a power greater than these had laid hold of her soul. She felt
again the strength of it, the invisible power that wrestled with her.
She walked slowly across her room again to the window and knelt
down, resting her hands on the sill, and looking out toward the
western sky. The sun had set and above the red cloud at the horizon
she discerned a solitary star, keen and white and quivering, a
spearhead of glory. She lifted her face toward it, the soft wind
stirring the tendrils of hair on her white forehead, and touching her
feverish cheeks and lips.
Gradually, silently, with infinite beauty, the afterglow touched the
soft sky with all the colors of rose and violet, and the earth below
sank gently and deeply into the shadow, as if it had dropped from
sight. It seemed to Diane that, in that silence, in the tenderness, the
infinite beauty of that moment between sunset and twilight, the
spiritual struggle ceased. A new thought came to her, or rather her
inner consciousness shaped itself into a concrete form. She realized
that she stood on the edge of an abyss while the power that had
held her back had been within her own soul, hidden deep in her
heart, at the mainspring of life itself. She was a woman, it was her
province to build up and not to break down, she saw it now with a
spiritual insight that sent a shudder through her—she had so nearly
forgotten it! So nearly failed to fulfill the destiny that had come
down to her through the ages. To-day when she had been with
Overton, when she had heard his impassioned plea, when she had
almost signed the paper that was to separate her from her husband,
she had suddenly awakened from her dream. The tie that bound her
to Arthur Faunce was the primitive bond of all the ages. She had
chosen him, he was her husband. What could her father do? What
could Overton, or any other man do? “Those whom God hath joined
together,” the words came to her with a new meaning, a meaning
which shook her to her soul. For surely no man could put them
asunder! The tie was too deep, it was rooted now in her heart, and
she knew it. It was as deep as the instinct which was awakening
slowly but surely within her, the primal instinct of life, of mating
time, of the birds of the air, of the lioness calling to her mate in the
jungle.
Diane lifted her eyes slowly and steadily toward that keen star. It
seemed to her that it penetrated the mists that had obscured her
soul, as the star of old which guided the wise men to the cradle in
the manger. The star was guiding her, too, guiding her into the
tender mists and the soft glory of an unknown but beautiful land.
Tenderness was born in her at last, a tenderness new and beautiful
—as the beginnings of life in the springtime, the budding of flowers,
and the song of the bird to its mate. Alone on her knees in the
twilight, Diane lifted her soul to that distant star, the thought of
Overton passed away from her, the struggle ceased, even her father
and his anger were forgotten, she remembered only her husband,
and the eternal purposes of the Creator who had made them man
and woman in the Garden of Eden.
XXXIV
It was not until he got a clear look at Arthur Faunce’s face under the
strong light of the reading-lamp that Dr. Gerry realized the full effect
of the crisis, moral and physical, upon the younger man. The old
doctor had come in to New York on business connected with his
practise, and in the evening, on his way to the station, he had
looked up the apartment-house from which Faunce had phoned to
him on more than one occasion. He had found him alone,
completing his arrangements for the departure of the expedition to
the south pole. Faunce had been glad to see him, had furnished
some cigars and a light, and the two men sat on opposite sides of
the table, both facing the open windows that looked out over a
crowded thoroughfare not far from the heart of the city.
Even at this late hour the clamor of traffic came up to them, and the
variegated lights of the flashing signs revolved, flashed, and receded
and flashed again with all the colors of a kaleidoscope. But the
steady light of the lamp on the table revealed Faunce’s face, its
wasted look, the dark rings under the somber eyes, the drawn lines
about the tight lips, the threads of white in the thick, dark hair that
still curled slightly on the temples. The doctor’s practised eye
traveled lower and rested on the lean, blue-veined hand that held
the cigar. It was unsteady; even the fingers twitched occasionally.
They had been talking, ever since Dr. Gerry’s entrance, of the
expedition. Faunce threw into what he said of it a show of force and
even of enthusiasm, and the doctor had listened without showing
that his own thoughts recurred persistently to that night long ago
when this man had confessed to him in the old office at home. In his
heart he pitied Faunce, as he noticed the feverish eagerness with
which he talked of the new ship and his own plans.
“I’ve got one thing pretty well shaped in my mind,” Faunce said.
“The last time I couldn’t have a free hand, of course, and I always
thought some of our mistakes could have been avoided. But Overton
wouldn’t yield; he has the kind of obstinacy that won’t give up.” He
paused long enough to light another cigar, and then went on: “I’ve
been pestered by some of the old men. I didn’t want them, but
there’s one——” He stopped abruptly, began to pull at his cigar, and
seemed embarrassed.
“Well, there’s one——”
Gerry gave him a keen glance. A dull red mounted in the white face,
and Faunce frowned.
“He knows, or thinks he knows, something about the other
expedition, and suspects that I can’t afford to risk his telling it.”
“I thought, at one time, that you dreaded the secret; yet you’ve let
Overton keep back the truth. You’re up to your neck in his debt.”
Faunce leaned forward in his chair, his shoulders bent like an old
man’s, and his clasped hands hanging between his knees.
“I feel the same way now, but we agreed to keep it quiet—there
didn’t seem to be any other way.”
“And he gave up the command to you, too. It seems to me you’re
getting a good deal more out of it than he is—on the face of it, at
least.”
“You think he’s paying a big price for a broken potsherd? Well, he
isn’t doing it for my sake!” Faunce sank back again in his seat, the
spark of his half-smoked cigar dying out between his fingers. Then
he turned his head quickly and fixed his haggard eyes on the doctor.
“Have you seen my wife lately?”
Gerry shook his head.
“Not for some days—a week, I think.”
“I wrote to her, asking her to answer me herself. If she really wants
a divorce, she shall have it; but I want her to answer me, and she
hasn’t. I’ve been wondering if she ever got my letter.”
“You mean, you think the judge has kept it from her? He isn’t
capable of that. He would give it to her in any case.”
“That’s what I thought; but he has insulted me, I can’t go to the
house, and she hasn’t answered my letter.”
The doctor picked up an ivory paper-knife from the table and began
to run it back and forth between his fingers.
“It would be natural enough, wouldn’t it, for any woman to expect
you to come to the house and ask such a question as that in
person?”
“You think I haven’t the courage?”
“I think you’re taking chloral to an extent that’ll soon send you on
the long expedition. It’s a dangerous drug, young man. A bit too
much, and you’ll travel the common road. Perhaps that’s your idea?”
Faunce laughed bitterly.
“You forget I’m a coward!”
“Sometimes cowards take that way—it’s easy.”
“Don’t be alarmed, I sha’n’t! I’ve always had a tenacious wish for
life. If I hadn’t had it, I’d never have done—the thing I did. I simply
couldn’t risk dying.”
“Yet you’re going back down there!”
Faunce gazed at the doctor a little wildly, his eyes shining.
“It draws me—I can feel it! But I’ll take no risks; don’t be afraid of
that. I know—know perfectly—that I’ll never risk my own skin, no
matter how I risk others’.”
The doctor looked at him curiously. “There are two men in you,
Faunce. Dose out the one with heroic medicine, and the other would
have room to grow. You’d find yourself a hero!”
Faunce turned a haggard face on him.

You might also like