Node Web Development 2nd New edition Edition Herron instant download
Node Web Development 2nd New edition Edition Herron instant download
https://ebookfinal.com/download/node-web-development-2nd-new-
edition-edition-herron/
https://ebookfinal.com/download/node-js-web-development-3rd-revised-
edition-david-herron/
https://ebookfinal.com/download/web-development-with-mongodb-and-
node-3rd-edition-dmello/
https://ebookfinal.com/download/web-development-with-mongodb-and-node-
third-edition-bruno-dmello-joseph-mithun-satheesh/
https://ebookfinal.com/download/restful-web-api-design-with-node-js-
second-edition-bojinov/
https://ebookfinal.com/download/mean-web-development-2nd-edition-amos-
q-haviv/
https://ebookfinal.com/download/the-modern-web-multi-device-web-
development-with-html5-css3-and-javascript-1st-new-edition-edition-
peter-gasston/
https://ebookfinal.com/download/agile-web-development-with-
rails-7-2nd-edition-sam-ruby/
https://ebookfinal.com/download/human-factors-and-web-development-2nd-
edition-julie-ratner-editor/
Node Web Development 2nd New edition Edition Herron
Digital Instant Download
Author(s): Herron, David
ISBN(s): 9781849515146, 184951514X
Edition: 2nd New edition
File Details: PDF, 3.13 MB
Year: 2011
Language: english
Node Web Development
David Herron
BIRMINGHAM - MUMBAI
Node Web Development
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-849515-14-6
www.packtpub.com
Reviewers Proofreader
Blagovest Dachev Aaron Nash
Matt Ranney
Indexers
Acquisition Editor Hemangini Bari
Sarah Cullington Tejal Daruwale
David Herron has worked in the software industry, holding both developer and
quality engineering roles, in Silicon Valley for over 20 years. His most recent role was
at Yahoo! as an Architect of the Quality Engineering team for their new Node-based
web application platform.
Before Sun, he worked for VXtreme on the video streaming stack, which eventually
became Windows Media Player when Microsoft bought that company. At The
Wollongong Group, he worked on both e-mail client and server software and was
part of several IETF working groups improving e-mail-related protocols.
I wish to thank my mother, Evelyn, for, well everything; my father, Jim; my sister,
Patti; and my brother, Ken. What would life be without all of you?
I wish to thank my girlfriend, Maggie, for being there and encouraging me, her belief
in me, her wisdom and humor, and kicks in the butt when needed. May we have
many more years of this.
I wish to thank Dr. Ken Kubota of the University of Kentucky, for believing in me,
and giving me my first job in computing. It was six years of learning not just the art
of computer system maintenance, but so much more.
I am grateful to Packt Publishing for giving me this opportunity to write a book, for
making me realize that my dream is to write books, and for their expert guidance
through the process.
I am grateful to Ryan Dahl, Isaac Schlueter, and the other Node core team members
for having the wisdom and vision needed to create such a joy-filled fluid software
development platform. Some platforms are just plain hard to work with, but not this
one, and that takes vision to implement it so well.
About the Reviewers
Blagovest Dachev has been writing software for the Web since 2002. He went
through the full spectrum of development by starting out with HTML, CSS, and
JavaScript, then moving into the server and database world. Blagovest was an
early adopter of Node.js and had contributed to several open source projects. He
is currently a software engineer for Dow Jones & Company, where he works on a
widget framework allowing third parties to search and display news on
their websites.
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.
com and as a print book customer, you are entitled to a discount on the eBook copy.
Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
http://PacktLib.PacktPub.com
Why Subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print and bookmark content
• On demand and accessible via web browser
[ ii ]
Table of Contents
[ iii ]
Table of Contents
[ iv ]
Preface
Welcome to the world of developing web software using Node (also known as Node.
js). Node is a newly-developed software platform that liberates JavaScript from the
web browser, enabling it to be used as a general software development platform
in server-side applications. It runs atop the ultra-fast JavaScript engine from the
Chrome browser, V8, and adds in a fast and robust library of asynchronous network
I/O modules. The primary focus of Node is on building high performance, highly
scalable server and client applications for the "Real Time Web".
The platform was developed by Ryan Dahl in 2009 after a couple of years of
experimenting with developing web server components in Ruby and other
languages. The exploration led him to the architectural choice of using asynchronous
event-driven systems rather than the traditional thread-based concurrency model.
This model was chosen because it's simpler (threaded systems are notoriously
difficult to develop), has lower overhead over maintaining a thread-per-connection,
and for speed. The goal of Node is to provide an "easy way to build scalable network
servers". The design is similar to and influenced by other systems such as Event
Machine (Ruby) and Twisted framework (Python).
This book, Node Web Development, focuses on building web applications using
Node. We will be taking a tour through the important concepts required to speed up
with Node. To do so we'll be writing real applications, dissecting them to scrutinize
how they work, and discussing how to apply the ideas to your own programs. We'll
install Node and npm, and learn how to install or develop npm packages and Node
modules. We'll develop several applications, ponder the effects of long-running
calculations on event loop responsiveness, look at a couple of ways to distribute
heavy workloads to other servers, work with the Express framework, and more.
Preface
Node programs can be edited with any text editor, but one that can handle
JavaScript, HTML, CSS, and so on will be useful.
[2]
Preface
While the book is about developing web applications, it does not require you to have
a web server. Node provides its own web server stack.
Server-side engineers may find the concepts refreshing, giving you a different
perspective on web application development. JavaScript is a powerful language and
Node's asynchronous nature plays to JavaScript's strengths.
Developers experienced with JavaScript in the browser may find it fun to bring that
knowledge to a new territory, and to write in JavaScript without accessing the DOM.
(There's no browser, hence no DOM, unless you install JSDom.)
While the chapters build on each other, how you read this book is up to you.
We assume you already know how to write software, and have an understanding of
modern programming languages such as JavaScript.
Conventions
In this book, you will find a number of styles of text that distinguish between
different kinds of information. Here are some examples of these styles, and an
explanation of their meaning.
Code words in text are shown as follows: "The http object encapsulates the HTTP
protocol and its http.createServer method creates a whole web server, listening
on the port specified in the .listen method."
When we wish to draw your attention to a particular part of a code block, the
relevant lines or items are set in bold:
var util = require('util');
var A = "a different value A";
[3]
Preface
New terms and important words are shown in bold. Words that you see on the
screen, in menus or dialog boxes for example, appear in the text like this: "A real
security system would have fields for at least a username and password. Instead
we'll skip this and just ask the user to click the Login button."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or may have disliked. Reader feedback is important for us
to develop titles that you really get the most out of.
If there is a book that you need and would like to see us publish, please send
us a note in the SUGGEST A TITLE form on www.packtpub.com or
e-mail [email protected].
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide on www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.
[4]
Preface
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you would report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/support, selecting your book, clicking on the errata submission form link, and
entering the details of your errata. Once your errata are verified, your submission
will be accepted and the errata will be uploaded on our website, or added to any list
of existing errata, under the Errata section of that title. Any existing errata can be
viewed by selecting your title from http://www.packtpub.com/support.
Piracy
Piracy of copyright material on the Internet is an ongoing problem across all media.
At Packt, we take the protection of our copyright and licenses very seriously. If you
come across any illegal copies of our works, in any form, on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
We appreciate your help in protecting our authors, and our ability to bring
you valuable content.
Questions
You can contact us at [email protected] if you are having a problem with
any aspect of the book, and we will do our best to address it.
[5]
What is Node?
Node is an exciting new platform for developing web applications, application
servers, any sort of network server or client, and general purpose programming. It
is designed for extreme scalability in networked applications through an ingenious
combination of asynchronous I/O, server-side JavaScript, smart use of JavaScript
anonymous functions, and a single execution thread event-driven architecture.
The Node model is very different from common application server platforms that
scale using threads. The claim is that, because of the event-driven architecture,
memory footprint is low, throughput is high, and the programming model is
simpler. The Node platform is in a phase of rapid growth, and many are seeing it
as a compelling alternative to the traditional—Apache, PHP, Python, and so on—
approach to building web applications.
It is implemented around a non-blocking I/O event loop and a layer of file and
network I/O libraries, all built on top of the V8 JavaScript engine (from the Chrome
web browser). The I/O library is general enough to implement any sort of server
implementing any TCP or UDP protocol, whether it's DNS, HTTP, IRC, FTP, and
so on. While it supports developing servers or clients for any network protocol, the
biggest use case is regular websites where you're replacing things like an Apache/
PHP or Rails stack.
Discovering Diverse Content Through
Random Scribd Documents
SPRING
CHAPTER II
Spring
In azure now out of grey mist grew
My own sweet violet, shy and blue,
With eyes of smiling sunshine
And tears of diamond dew.
The Prince of Winter sat on the mountains and gazed upon the
valley.
He knew that Spring must soon be here and anxiously looked out for
him. But there was nothing to see but snow and snow and yet more
snow; and he began to think that young Spring was afraid.
He laughed scornfully and sent his gales howling round the
mountain-peaks. Wildly they rushed over the hills, snapped great
trees in the wood and broke the ice on the river to pieces. They
drove the floes before them, flung them over the meadows and
whipped the water into foam.
“There, there!” said Winter. “Softly, my children, softly!”
He bade them go down again; and, grumbling, they crept round
behind the mountains.
When night came and the stars twinkled, Winter stared at the river
with his cold eyes; and there and then there was ice again upon the
water. But the waves broke it into two at once. They leapt and
danced and cracked the thin crust each time that it formed over
them.
“What’s this?” asked Winter, in surprise.
At that moment, a soft song sounded far down in the valley:
Play up! Play soon!
Keep time! Keep tune!
Ye wavelets, blue and tender!
Winter clutched his great beard and leant forward to listen. Now the
song sounded again and louder:
Play up! Play soon!
Keep time! Keep tune!
Ye wavelets, blue and tender!
Keep tune! Keep time!
Burst ice and rime
In equinoctial splendour!
Up sprang Winter and stared, with his hand over his brows.
Down below in the valley stood the Prince of Spring, young and
straight, in his green garb, with the lute slung over his shoulder. His
long hair flowed in the wind, his face was soft and round, his mouth
was ever smiling, his eyes were dreamy and moist.
“You come too soon!” shouted Winter.
But Spring bowed low and replied:
“I come by our appointment.”
“You come too soon!” shouted Winter again. “I am not nearly done.
I have a thousand bags full of snow and my gales are just as strong
and biting as they were in January.”
“That is your affair, not mine,” said Spring, calmly. “Your time is past
now, and my sway is beginning. Withdraw in peace to your
mountains.”
Then Winter folded his strong, hairy hands and looked anxiously at
Spring:
“Give me a short respite!” he said. “I implore you to grant me a little
delay. Give me a month, a week; give me just three poor days.”
Spring did not answer, but looked out over the valley, as though he
had not heard, and loosened the green silk ribbon by which he
carried his lute.
But the Prince of Winter stamped on the mountains till they shook
and clenched his fists in mighty anger:
“Go back to whence you came,” he said, “or I shall turn my snows
over you and bury you so deep that you will never find your way out
of the valley. I shall let loose my storms till your wretched strains are
drowned in their roaring. Your song shall freeze in your throat.
Wherever you walk or stand, I shall follow your tracks. Whatever you
call forth by day I shall slay by night.”
Spring raised his head and strode through the valley. He plucked
harder at the strings of his lute and every tree in the forest bent
forward to listen. The earth sighed under the snow, the waves of the
river stood still and heard and then joined in the song, as they leapt
towards the sea. Winter himself swallowed his anger for a moment
and listened to Spring’s song:
In vain thy prayer would soften, in vain thy menace frighten;
Behind the blackest cloud-wrack, the sunbeams laugh and lighten.
It rang through the valley in long, loud, solemn tones; and Echo
answered from every hill and mountain.
But Winter shook his clenched fists to the sky and shouted aloud:
“Out, all my mighty storms! Out with you, out! Burst down upon the
valley and shatter and destroy all this! Rush over the hills and snap
every tree in the forest! Overturn the mountains, if you can, and
crush yonder green mountebank beneath them!”
Out rushed the storm; and the snow came. It was awful weather.
The trees creaked and crashed and fell, the river overflowed its
banks, the foam of the waves spurted right up to the sky, great
avalanches of snow poured down the mountain-slope.
But Spring went his way through the valley and sang, in ever fuller
and stronger tones:
Let all thy loud winds bluster, let all thy tempest bellow;
Let all thy white, bright snow-birds loose, across the meadow
flying!
Behold my foot is on the bridge and all the ice-flowers dying!
Thou knowest thy power in the vale has met its conquering fellow.
“Better than that!” shouted Winter. “Roar, storm; whirl, snow; lash,
rain; beat, hail!”
And the storm roared louder; and the snow whirled down. It grew as
dark as though the sun, the moon and all the stars had been put
out. Great blocks of stone rolled down over the valley; the
mountains shook and split. It was as though the end of the world
had come.
But high through the murk shone Spring’s green garb; and louder
than storm and thunder rang his song. Earth and air and water sang
with him: the poorest blade of grass beneath the snow, the crow in
the wood, the worm in the mould, each of them joined in the song
according to its power. Even the trees that fell in the forest under
the onslaught of the storm confessed Spring in the hour of their
death:
Thou knowest it were best to yield to save thy might from falling;
Thou knowest I am come to drape the porch of Summer’s palace.
Thy victims, harried on the hills and murdered in the valleys,
Awake to life, to happy life, at my soft song’s recalling.
Then Winter gave in.
The storm flew north over the mountains with a howl; and it
stopped snowing. The river returned to its bed. Now and again there
was a crash in the forest, when a branch that had been struck by
lightning fell to the ground. Otherwise all was still.
And then it began to thaw.
The snow had often sparkled in the sun and rejoiced, but that was a
different sun from the one that now stared down upon it. The sun
now riding in the sky disliked the snow and the snow disliked the
sun.
“What on earth do you want here?” asked the sun and stared with
ever-increasing curiosity.
And the snow felt quite awkward and wished itself miles away. It
melted up above till great holes came; and it melted down below till
it suddenly collapsed and turned to nothing, more or less.
Everywhere underneath it, the water ran in rills: through the wood,
down the hillside, over the meadow, out in the river, which carried it
patiently to the sea. Everywhere stood puddles of water, large and
small; they soaked slowly into the ground, as its frozen crust
disappeared by degrees. But sometimes they had to wait, for the
ground was hard put to it to drink so much at a time.
And, while it thawed, harder and harder, and the coat of snow grew
thinner every day, Spring stood on the edge of the wood and bowed
to the earth and sang:
My little snowdrop, gentle sprite,
Thy heart was ever brave and bright.
Not once it faltered, pierced with fright,
At Winter’s white wrath bleeding.
Under Spring’s song, a hundred snowdrops burst from the ground
and shone forth white and green. They nodded their heavy heads;
and Spring nodded to them. But then he went on, till he stopped
again, farther away, and sang:
And quick, each tiny crocus, too,
Put on your frocks of daintiest hue,
Frocks yellow, white and dusky-blue,
In full first clusters leading!
The crocuses at once opened their flowers and strutted, short as
they were, for they were ever so proud of being among the first.
But, while they were still swarming out, already Spring was in a
fresh place and sang:
Climb, whitlow-grass, thy willow-mast!
O where art thou? Yet sleeping fast?
Thou wast not wont to enter last:
Up, lower plants preceding!
And all the willow-branches were filled forthwith with the yellow
flowers of the whitlow-grass, which nodded gladly to the crocuses
and snowdrops. And Spring sang again:
Dear fresh spurge-laurel, briskly grow!
Thou, whose keen lance with fiery glow
Would burst the lap of the cold snow,
Come forth: obey my pleading!
There stood the spurge-laurel, like a bright-red birch-rod ready for
use on Ash Wednesday. But Spring pulled the lower branches of the
bush aside and bent still more deeply towards the ground and sang
more softly than ever:
Thou of all symbols, dearest yet,
My true, my lovely violet!
Soon sun will burn, soon rain will wet:
Be ready, no call needing!
And the violet shot up its broad green leaves from the ground to
show Spring that it was ready.
Then the mist floated out over the valley. No one could see where it
came from, but it came and remained for many a long day.
They were strange, silent days. Everywhere, everything oozed and
bubbled and rustled and seethed in the ground; and there was not a
sound besides. Noiselessly, the mist glided over the hills and into the
woods and hung heavy dew-drops on every single twig. And the
dew-drops dripped and fell from morn till eve and from eve till morn.
So thick was the mist that the river was hidden in it, till one could
only hear it flow. And the hills were hidden and the woods, till one
saw nothing but the outside trees and even that only as shadows
against the damp, grey wall of mist.
But where the mist was thickest there was Spring. And the thicker
the mist grew the brighter shone Spring’s green garb. And, all the
time that the water oozed and the dew-drops dripped and the river
flowed, Spring sang:
Softly slipping,
Little drop, go dripping, dripping!
But up in the mountains lay the Prince of Winter and lurked. He saw
how the snow melted and disappeared; he saw the flowers come
and could do nothing to prevent it. The snow melted right up in the
mountains; and he felt that it would become a bad business indeed
if he did not put a stop to it.
So he stole down to the valley in the darkness of the night; and,
next morning, there was ice on the puddles and the mist lay beaten
down upon the meadow in sparkling hoar-frost.
But, when the young Prince of Spring saw this, he only laughed:
“That’s no use,” he said.
Then he raised his young face to the sky and called:
“Sun! Sun!”
And the sun appeared.
The clouds parted at once; and the sun melted the ice and the hoar-
frost. Then he hid again behind the clouds. The mist floated over the
hills anew, everything oozed and bubbled and rustled and dripped.
The snowdrop and the crocus and the willow-wood blossomed that it
was a joy to see; and the violet cautiously stuck its buds above
ground.
“Now all is well!” said Spring.
And, as he spoke, a sprightly wind came darting over the hills.
It shook the dew-drops from the boughs of the trees, till they fell to
the ground in a splashing rain. Then it fluttered through the old dry
grass in the meadow, crested the waves of the river and scattered
the mist in no time. Then it set about drying the wet ground and
drove the clouds over the mountains. There they remained hanging
and hid the angry face of Winter. But, day after day, the sun rode in
a bright blue sky; and it grew warm in the valley.
Then the violet burst forth. It hid bashfully among its broad green
leaves, but its scent spread wide over the meadow. And Spring
plucked at the strings of his lute and sang till the valley rang again:
In azure now out of grey mist grew
My own sweet violet, shy and blue,
With eyes of smiling sunshine
And tears of diamond dew.
And, when Spring had sung that song—and it rang to the top of the
mountain, to the bottom of the river, to the very ends of the valley—
then everything came on at about the same time and at a pace that
can hardly be described.
At night, the valley was full of sound. But none could hear it whose
heart was not full of green boughs. For it was the sound of buds
bursting, little green sheaths unrolling, twigs stretching, flowers
opening, scent spreading and grass growing.
By day, it was sometimes sunshine and sometimes rain, but always
good. And what happened then could be seen by any one who had
eyes to see with.
First, the ground in the wood became quite white with anemones.
So white did it all become that the Prince of Winter, who was
peeping down through a rift in the clouds, thought for a moment
that there was snow. He was gladder than he had been since
February. But, when he saw his mistake, he stole into the wood one
night, for the last time, and bit in two the necks of all the flowers
that he could.
But a thousand new ones came for every one that died. And in the
midst of the anemones stood the larkspur and the lungwort, which
had blue and red flowers, to suit your fancy; the star of Bethlehem,
which was a bright golden-yellow, but modest nevertheless; the
wood-sorrel, which was so delicate that it withered if you but
touched it; the cowslip; and the speedwell, which was small enough,
but very blue and proud as Lucifer.
The meadow got itself a brand-new grass carpet, ornamented with
yellow patches of buttercups and dandelions. Along the ditches it
was bordered with dear little cuckoo-flowers and out towards the
river it had a fringe of rushes that grew broader and thicker day by
day. Below, from the bottom of the lake, sprang the water-lily’s thick
stalks, vying one with the other who should reach the surface first;
and the frogs, who had been sitting in the mud and moping all
through the winter, crawled out and stretched their hindlegs and
swam up and uttered their first “Quack! Quack!” in such a way that
you could not have helped feeling touched.
But the crows and the sparrows and the chaffinches, who had spent
the winter down in the valley, raised so great a hubbub that it
seemed as though they had taken leave of their senses. They ran
round the meadow and pecked at the soft ground and nibbled at the
grass, though they knew quite well that it would disagree with them.
They flapped their wings and shouted, “Hurrah for Spring!” in a way
that showed they meant it. The tit was there too and the wren,
small as she was. For they had been there all the time, like the
others, and fared just as hard.
And the crow simply did not know which leg to stand upon. He
started a croaking-match with his old woman, with whom he had
lived the year before and all through the winter and with whom,
since last February, he had had a great quarrel about a dead
stickleback. The sparrow sat down beside his missus, stuck his nose
in the air and sang as though he were the nightingale himself. The
tit was perfectly delirious with spring. He shut his eyes and told his
mate the maddest stories about delicious worms and big, fat flies
that flew right down your throat without your having to stir a wing.
And Mr. Chaffinch got himself a grand new red shirt-front, which
made Mrs. Chaffinch nearly swoon away with admiration. But the
wren, whose husband had died of hunger at Christmas, preened and
polished her feathers so that she might be taken for the young and
lively widow that she was.
And the Prince of Spring laughed and nodded kindly to them:
“You are a smart lot, one and all of you,” he said. “And you have
gone through trouble and deserve a happy day. But now I must get
hold of my own birds.”
He turned to the South and clapped his hands and sang:
Then the air hummed with the beat of a thousand wings and the
army of birds of passage fell like a host upon the valley. Each night
the air was vocal with the passing of the birds; and in the morning
there was no end to the twittering.
There sat the starling and whistled in his black dress-coat, with all
the orders on his breast. The swallow swept through the air; siskin
and linnet, nightingale and blackcap hopped about in the
copsewood. The reed-warbler struck his trills in the rushes along the
river-banks so touchingly that one could weep to hear it, the thrush
took the deep notes and the goldfinch the high ones, the cuckoo
ventured upon his first call and the lapwing sat on his mound and
swaggered. But the stork walked in the meadow and never
vouchsafed a smile.
Meanwhile, the whole wood had come out, but the leaves were still
small, so that the sun was able to peep down at the anemones.
Lilies of the valley distilled their fragrance for dainty nostrils and
woodruffs theirs for noses of the humbler sort. The green flowers of
the beech dangled from the new thin twigs; cherry and blackthorn
were white from top to toe; valerian and star of Bethlehem and
lousewort did their best. The shepherd’s pouch, that blossomed the
whole year round, was annoyed that no one took any notice of it,
but the orchis stood and looked mysterious and uncanny, because it
had such strange tubers in the ground.
Far in the beech-thicket, where it was greenest and prettiest, sat a
lovesick siskin and courted his sweetheart, who hopped on a twig
beside him and looked as if she simply could not understand what
he was driving at.
He sang:
If only, love, thou wilt be mine,
If now my singing heard is,
A nest I’ll give thee soft and fine
With four delightful birdies.
When he had sung his ditty to the end, he looked hard at her and,
as she did not answer him at once, he gave her a sound peck with
his beak.
“Don’t do that!” she said.
But, when he ceased pecking at her and raised his wings, as though
he meant to fly away, she hastened to sing:
Yes, I will be thy own dear love,
Of bairns we’ll prate together;
With few would I have flown, dear love;
So preen a prouder feather!
Then they flew singing through the wood. And they were hardly
gone before two other birds came and sat on the same twig and
sang the same thing in another manner.
But the leaves of the beech grew and there came more and more.
They gathered closer and closer over the wood and, one fine day, it
was quite impossible for the sun to find a hole to peep through.
Then the anemones became seriously frightened:
“Shine on us, Sun, or we shall die!” they cried.
They cried to the wind to sweep the horrid leaves away, so that the
sun could see his own dear little anemones. They cried to the beech
that it ought to be ashamed of itself, great, strong tree that it was,
for wishing to kill innocent flowers. They cried to Spring to help
them in their distress.
But the sun did not see them and Spring did not hear them and the
beech took no heed of them and the wind laughed at them. There
was such gladness in the valley that it drowned their voices; and
they died quite unnoticed.
Every single day, new flowers came which were radiant and fragrant.
Every single day, the birds discovered a new trill to add to their
song. The stag belled in the glade, before even the sun was up, and
the hind answered and sprang. Every second, the fish leapt in the
water; and there was no end to the croaking of the frogs in the
ditch. The snake wriggled along the edge of the brook and made
play with his tongue; in every hedge sat small brown mice
exchanging amorous looks. Even the flies buzzed more fondly than
usual.
But, when the gladness was at its highest, the young Prince of
Spring stood at the top of the valley, where the mountains enclose it
towards the North. He looked out over his kingdom. His eyes were
moist and dreamy, his mouth was ever smiling. He loosened from his
shoulder the green silk ribbon in which his lute was slung, plucked
once more at the strings and hummed to its accompaniment. It was
a beautiful, hazy day, a day on which the birds subdued their songs
and the flowers closed their petals.
And Spring bowed over a little blue flower that sprouted at his foot
and sang, sadly:
Forget-me-not blue,
Thou dreamy one,
Thou charming one,
Thou sweet one!
Then he went northwards. And, wherever he set his foot, the snow
melted and the flowers burst forth.
But, when he had come to the last place from which he could see
the valley, he turned round.
And far away towards the South, where the valley runs into the
plain, stood the Prince of Summer, tall and straight. His face and his
hands were brown with the sun, his eyes gentle and warm as the
sun. Over his shoulder he wore a purple cloak, around his loins a
golden girdle. In the girdle was a wonderful red rose.
Then Spring bowed low and went away over the mountains.
SUMMER
CHAPTER III
Summer
Now bosky darkness grows.
The gradual summer-light bestows
Faint star-light on each hollow.
None had noticed Spring’s farewell or Summer’s coming.
The birds sang and the flies buzzed. The gnats danced up and down
in the air, till the swallow broke up the ball; the flowers smelt sweet,
the frogs croaked, the stag belled in the glade. There was no end to
the universal gladness.
And, while the mountains were still turning green wherever Spring
had set his foot, right up to Winter’s eternal snows on the peaks, the
Prince of Summer stood for a time and surveyed the kingdom which
Spring had quitted.
His form sent forth so sunny a radiance that it grew hotter in the
valley than it ever had been. His eyes shone, his purple cloak
beamed, the golden girdle around his loins blazed like fire, the red
rose in his girdle glowed.
When he had stood a while, he raised his hand, as though he would
bid them be still. But none heeded him. The siskin hopped in the
thicket with his sweetheart, gave her loving looks and pecked at her
with his beak. The fish sported merrily in the water, the meadow
displayed all its glories and the wood stood lost in green dreams.
The Prince of Summer smiled and raised his hand once more. When
this had no effect, he knitted his brows and his face darkened.
And, at that moment, a veil passed over the sun. From east and
west, thick clouds came slowly over the hills, thicker and blacker
than the valley had yet seen and with strange, thick edges. From the
clouds rolled the thunder, distant and muffled, but such that none
could doubt its power.
The clouds came nearer and it grew ever darker, but no less hot for
that. Inside the wood, it was as though it were evening. The wind
took fright and ran away behind the hills and subsided. The air was
singularly close and heavy. The leaves of the trees hung slack, as
though they were sick, and the flowers hastened to shut their petals.
No one knew what became of the flies, but they were gone. The
little brown mice forgot their amorous nonsense and sat in their
parlours and squeaked. The stag took shelter behind the thickest
bushes; the croak of the frogs stuck in their throats and they went
down to the bottom as if Winter were at the door. The birds looked
round under the leafage and stared with frightened eyes.
And the Prince of Summer was no longer all light and sunshine.
Gradually, as the clouds closed up, the radiance that flowed from
him was extinguished. At last, he stood at the end of the valley like a
mighty black cloud in a warrior’s form.
Then there suddenly came a humming over the hills till every breath
of wind had left them altogether. The trees bent low in great dismay;
the river rose and leapt away like a horse that rears and shies.
Then it sounded as if a thousand light feet were running over the
ground: it was the first rain-drops coming. The next moment, the
rain poured down till every sound was drowned in its splashing.
There came a terrible lightning, which made everything visible, but
which dazzled all eyes, so that they could not see. Then came the
blackest darkness and then the thunder, till the mountains shook
again.
But through the thunder sounded Summer’s accents; and never had
any heard so loud a voice:
“It is I, Summer, who am come to reign over the land. Mine is the
thunder that roars over the valley. Hark!... The echo rolls from the
mountains; the earth rumbles under my foot: it is Summer coming.”
The thunder ceased, but the rain kept on pouring. And through the
rain spoke Summer’s accents; and never had any heard so soft a
voice:
“It is I, Summer, who am come to reign over the land. All that is
green shall be greener still; all that is fair shall be a thousand-fold
fairer. The scent of the flower shall be sweeter yet; and the sound of
the bird’s trill shall be deeper and fuller. The days shall break earlier
in the East and be lighter and warmer; the nights shall be cool and
still; and there shall be no end to the joy of the morning nor to the
evening’s peace.”
When the Prince of Summer had spoken, while all things in the
valley bowed and listened and understood, the thunder ceased and
the rain fell no longer.
Tall and straight and radiant, Summer advanced through his
kingdom.
And, wherever he came, the clouds parted and vanished east and
west behind the hills. The sky grew clear again and the drops of
water that hung on every twig and every blade of grass glistened in
the sunlight. The flowers opened, the birds came out from under the
leafage, the stag left his cover and plunged his muzzle into the wet
grass.
But, when the last cloud was gone and the sun had dried up the last
drop of water and every single trace of the storm was removed,
nevertheless things were nowhere the same as they were before the
thunder passed over the valley.
More flowers came and new flowers; and their scent was sweeter
and their colour brighter, even as the Prince of Summer had said.
But it was as though they had all become more serious. They no
longer swung so carelessly on their stalks, no longer scattered their
scent so lavishly to every wind. But, when a bee or a butterfly came
flitting up, all the flowers stretched their necks and shed a redoubled
radiance and fragrance and cried their honey aloud, so that the
insects might come along and take their pollen-ware.
Nor did the bees themselves have so good a time as in the green
days of Spring. At home, in the hive, their queen was laying eggs by
the hundred; and they had to sweat wax and build cells and fetch
honey and pollen, till they were nigh dying with exhaustion. And
there were so many flowers that the bees did not know where to
turn. In the wood, they got drunk on the sweet scent of the linden-
blossom and the honeysuckle; beside the brook, they fluttered
plump into the red cap of the poppy. Not one of them was man
enough to say no to those flower-cups: the thistle and the burdock,
the dandelion and the wild chamomile, all kept them hard at work.
Did they come to the hedge, the elderberry called them; would they
rest in the grass, the bindweed offered them its chalice with fresh
dew-drops on the edge and honey at the bottom; did they fly across
the lake, the water-lily lay with her white and yellow blossoms and
nodded on the silent waters.
And even as with the flowers and the bees, so it was everywhere.
Not anywhere were things as they had been.
However many trills the siskin struck for his sweetheart, however
fondly he put his head upon one side, however eagerly he pecked at
her with his beak, she minded not a jot, but stared silently and
seriously before her:
“There’s that nest,” she said, at last.
“Of course, of course,” replied the siskin and looked as though he
had never thought of anything else.
“Yes, but it’s urgent!” said she. “We shall have the eggs before the
week is out.”
Then they found a place where they felt like building and together
they set to work.
But, wherever they hopped after a twig for which they had a use,
already other birds were hopping on the same errand and, wherever
they flew after a feather in the air, they had to hurry, lest another
should snatch it first. If he got hold of a lovely long horsehair, there
would never fail to be some one pulling at the other end; and, if she
flew out for some nice moss which she had noticed the day before,
she could be sure that her fair neighbour had been to fetch it that
morning. For every young couple in the wood was out after furniture
and fittings.
At last, the two siskins got their house built; and the other birds did
the same. There was not in the wood a bush so poor but it carried a
nest in its bosom. In every nest lay eggs; and on the eggs sat a
smart little bird-wife looking round watchfully with her black eyes
and boring herself most wretchedly. Every moment, her husband
would come home with a fly or a worm or some other good
nourishing food, as he had promised and as his duty bade him.
When evening came, all the bird-husbands sat faithfully on the edge
of the nest and sang, each with his little beak, so touchingly and
prettily that their wives thought it delightful to be alive.
But up in the tall trees the crow-wives sat on their eggs; and on the
cliffs the eagles’ consorts lay brooding.
Everywhere they were busy preparing for the babies; but not
everywhere was there so pretty a family-life as in the bushes in the
wood.
True, Mrs. Fox had her hole deep down in the hillside, where her
youngsters lay as snug as in their grandmother’s chest of drawers.
But the timid hare dropped her young ones in the ditch and had no
notion where their unnatural father was gobbling his evening
cabbage.
And the cuckoo flew round restlessly and slipped his eggs stealthily
into the others’ nests and cried most bitterly because he could never,
never build a home for himself. Nor was the snail much better off;
for she could do no more than make a hole in the ground, put her
eggs into it and commend them to Providence.
The little brown mice had their parlours full of tiny, blind children,
who could never wish for kinder or more thoughtful parents. But
Goody Mole, down in the earth, had to eat her own dirty husband as
soon as she had had her babies, lest he should eat the little
innocents for his lunch. And the gnat-husbands danced heedlessly in
the evening air, as though they had nothing better to do, while their
respective spouses, in great affliction, laid their eggs in the water.
But the brown frog sat by the ditch-side and wrung her hands in
speechless horror at the strange tadpole-children which she had
brought into the world.
And the sun shone and the rain fell on those who were comfortable
indoors and on those who had to take things as they came. Goody
Mole worked for two, like the decent widow that she was; and the
hare suckled her young so that they might gain strength quickly and
leap away from the eagle and the fox. The cuckoo uttered his
sorrowful note among the tall trunks of the forest; and Mother Gnat
let her eggs sail the pond for themselves, since that was all that she
could do for them, after which she settled in the stag’s ear and
helped herself to a drop of blood to repay her for her exertions.
But the Prince of Summer was with them all. He knew of the
smallest gnat and forgot not a flower in the meadow:
“It is well!” he said.
And, every day that passed, his purple cloak beamed, the golden
girdle around his loins blazed, the red rose in his girdle glowed.
Then it happened that a shocking cry rang out through the forest. It
was so loud that everything around grew silent and all listened to
hear what it could be.
The one who had uttered the cry was an old, gnarled oak who stood
among a crowd of fine young beeches:
“Prince of Summer, come to my aid!” he shouted. “Don’t you see
that the beeches are stifling me? Before you have made your entry
twice more into the valley, I shall be dead and buried under their
shade.”
“I see it,” said Summer, calmly.
“You see it?” cried the oak and wrung his old branches in despair.
“You see it and you don’t help me? Woe is me, to have a prince like
you! Then Spring indeed was a different sort of gracious lord and
king. There was not in the forest a stick so dry but he readily gave it
a green leaf or two.”
But the Prince of Summer looked with indifference at the old, dying
oak:
“I was never responsible for Spring’s green promises,” he replied. “I
reign here according to my own law, and the law ordains that you
shall die. What do I want with a fagot like you in my healthy
forests?”
Then he turned to the beeches and said:
“I gave you strength to grow. I give you twofold strength and
tenfold. Hasten and put that old gentleman to rest!”
And the beeches shot up aloft and threw their shade over the oak till
he died.
But there were others besides the oak that made their complaints to
the Prince of Summer. Every day and every hour of the day there
was one that threw up the sponge and shrieked for help.
There was the grass, which cried because the stag ate it.
“I made your number as the sand of the sea,” said the Prince of
Summer. “I gave you hardiness and a quick growth; I gave you the
wind to carry your seed across the meadows. For you I have done
enough.”
And there was the stag, who bellowed because the best grass was
gone. To him the Prince of Summer said:
“I gave you swift legs, so that you could bound where the grass is
greenest in the forest. If your legs are tired, then lay you down to
die; and the hind’s fawns shall walk in your footsteps.”
There were the fish in the river, who ate one another’s eggs and
young and then blamed Summer.
“What would you have me do?” asked Summer. “I gave you power
to lay a thousand eggs and a thousand more and a thousand
besides. However many may die, there will always be fish in the
river.”
And there were the flowers that sighed because there were not bees
enough to carry off their pollen. But the Prince of Summer said:
“I presented you with honey to give to the bees for a messenger’s
fee and taught you to hide it so that they must take your pollen into
the bargain. I gave you delicious perfumes and beautiful colours
wherewith to entice the bees. You call them and they come; and the
one that promises most and keeps its promise best is the one they
obey most quickly.”
But, every time that Summer spoke, there was a new one that
wailed:
“There are too few worms!” cried the siskin, who now had four
youngsters in the nest and was wearing himself to a skeleton in the
effort to provide food for them. “We are starving. We can never hold
out!”
“There are too many birds!” whined the worm in the mould. “If one
but stirs out for a moment, one is eaten up.”
“Deliver us from the stork!” prayed the frogs.
“Provide more frogs,” cried the stork, “or I shall have to go
elsewhere!”
And the beech complained because the cockchafer ate its leaves;
and the crows could never get cockchafers enough. The bees
whined about the flowers, as the flowers had done about the bees:
they considered that it was much too hard to get hold of the honey.
The hare ran away from the fox and fell into the talons of the eagle.
The young ash in the hedge raised his voice to heaven against the
honeysuckle that twined itself right up to his top.
But the Prince of Summer stood tall and straight and radiant and
surveyed his kingdom. His smile was wide and bright and there was
no pity in his hard eyes. He raised his hand, as though to bid them
be silent, but none heeded him; and the noise increased hourly and
the land was full of cries and lamentations.
Then he knitted his brows and called the thick black clouds from
behind the hills. They came at his beck; fear lay over the valley
again; and the cries were silenced. The thunder rolled till the
mountains shook, the lightning flamed, the rain poured.
And Summer’s great voice sounded through the air:
“Know you not that I am a lord as stern as Winter, whom you hate?
He reigns over death, as I do over life. I will be obeyed, like him; like
him, I crush whatever resists me. You thought I was a minstrel like
Spring, who sang you to life and longing and went off over the
mountains. But I am greater than Spring. For I satisfied your desires
with food and made you subject to the law of life. But the law is this,
that that which is hale shall stand, but that which is sick shall fall.
Therefore I made my days long, that you should become green and
grow. Therefore I gave you strength and power in a thousand ways,
the smallest gnat as well as the tallest tree in the forest, so that you
should fight and grow up. Therefore I gave you children, so that you
should never perish. And whoso obeys my law and well employs the
day, upon him the sunlight of my eyes shall fall. His strength shall
reign, his children shall bear his name throughout the ages. But
whoso flinches, he shall die.”
The Prince of Summer was silent and the thunder rolled away slowly
over the mountains. The clouds parted and vanished; it became
night. The stars shone bright and friendly, the trees dripped and all
was still.
But, next morning, the valley awoke to fiercer fighting and louder
cries than ever.
For there was not a bird in the forest nor a flower in the meadow
but had heard what the Prince of Summer said and understood it.
They all knew what it meant and armed themselves, before sunrise,
for the fight for life.
The siskin and his wife hunted twice as eagerly in the thicket; the
little brown mice dug twice as diligently; the flowers redoubled their
radiance and their fragrance. Goody Mole rummaged the ground in
every direction; the stag found a meadow where the grass stood
high and green. The beech put forth new twigs in the place of those
which the cockchafers had eaten; and the ash stretched its bows
right through the honeysuckle to show Summer that it was alive.
Thousands died, but none heard their death-moan, because of the
din that arose from the fight of the living. And it was as though more
lives came for each life that was extinguished.
The siskin’s youngsters hopped out of the nest and fell from the
branch and fluttered up again. The crow’s children screamed in the
tree-tops; the young eagles flew from the rock to try their wings.
The starling drove her first brood from the nest and laid new eggs;
the frog lived to see her degenerate young grow quite respectable
before she herself was swallowed by the stork.
Never had the fish swarmed so thickly in the river, never had the
beech’s leaves been so broad, never had the copsewood been so
dense, never had the flowers pressed so close together in the
hedge.
And the Prince of Summer stood amidst his kingdom taller and
straighter and more radiant than ever:
“It is well!” he said.
Then evening came. The crows flew home from their debating-club
in the old, dead oak; the little birds in the thicket sang their
evensong in chorus, but made it short, for they were very tired. The
flowers shut their petals; the bees closed the door of their hive. The
moth flew out on her soft, grey wings. The stars peeped out, ever
more and ever larger.
Carefully, the mist raised its head and spied and listened. And, when
all was still, it welled forth, white and grey and billowy and noiseless.
Now it lay quiet and dreamed, now it danced its queer dances over
the meads. It peeped into the wood, where the lime-tree was
shedding its perfume; it glided down to the river, which ran and ran
and was swallowed up in the darkness.
But, suddenly, from the edge of the wood, a long and jubilant trill
rang out over the valley:
Weet-a ... weet-a ... weet-a ... weet-a ... weet-a ... weet-a ... weet!
The mist stopped and listened. The stag raised his head in the
meadow, the birds opened their sleepy eyes and answered with a
little chirp.
Weet-a ... weet-a ... weet-a ... weet-a ... weet-a ... weet-a ... weet!
It was the nightingale, who sang:
Now bosky darkness grows.
The gradual summer-night bestows
Faint star-light on each hollow.
The merry little swallow
Has hied him to repose.
Weet-a ... weet-a ... weet-a ... weet-a ... weet-a ... weet-a ... weet!
While now the moon through Heaven sails
And all is still, blithe nightingales
With hedgerow music follow.
Weet-a ... weet-a ... weet-a ... weet-a ... weet-a ... weet-a ... weet!
In sleepy clusters gleaming,
White elders sigh, red roses start,
Forget-me-nots lie dreaming.
They dream of summer all night long
Whose splendour thrills that joyous song
In mellow sweetness streaming
From the green thicket’s heart....
AUTUMN
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com