Complete Node Js 8 The Right Way Practical Server Side JavaScript That Scales 1st Edition Jim Wilson PDF For All Chapters
Complete Node Js 8 The Right Way Practical Server Side JavaScript That Scales 1st Edition Jim Wilson PDF For All Chapters
com
https://textbookfull.com/product/node-js-8-the-right-way-
practical-server-side-javascript-that-scales-1st-edition-
jim-wilson/
OR CLICK BUTTON
DOWNLOAD NOW
https://textbookfull.com/product/node-js-web-development-server-side-
development-with-node-10-made-easy-fourth-edition-edition-david-
herron/
textboxfull.com
https://textbookfull.com/product/full-stack-javascript-learn-backbone-
js-node-js-and-mongodb-mardan-azat/
textboxfull.com
https://textbookfull.com/product/learning-node-moving-to-the-server-
side-early-release-shelley-powers/
textboxfull.com
Professional Node js Building Javascript Based Scalable
Software 1st Edition Teixeira Pedro
https://textbookfull.com/product/professional-node-js-building-
javascript-based-scalable-software-1st-edition-teixeira-pedro/
textboxfull.com
https://textbookfull.com/product/fullstack-node-js-the-complete-guide-
to-building-production-apps-with-node-js-davit-guttman/
textboxfull.com
https://textbookfull.com/product/jump-start-node-js-get-up-to-speed-
with-node-js-in-a-weekend-1st-edition-nguyen-don/
textboxfull.com
https://textbookfull.com/product/instant-node-js-starter-1st-edition-
teixeira-pedro/
textboxfull.com
Node.js 8 the Right Way
Practical, Server-Side JavaScript That
Scales
by Jim R. Wilson
Every precaution was taken in the preparation of this book. However, the publisher
assumes no responsibility for errors or omissions, or for damages that may result from
the use of information (including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team
create better software and have more fun. For more information, as well as the latest
Pragmatic titles, please visit us at http://pragprog.com.
Our ebooks do not contain any Digital Restrictions Management, and have always been
DRM-free. We pioneered the beta book concept, where you can purchase and read a
book while it’s still being written, and provide feedback to the author to help make a
better book for everyone. Free resources for all purchasers include source code
downloads (if applicable), errata and discussion forums, all available on the book's
home page at pragprog.com. We’re here to make your life easier.
Acknowledgments
Preface
Why Node.js the Right Way?
What’s in This Book
What This Book Is Not
Code Examples and Conventions
Online Resources
1. Getting Started
Thinking Beyond the web
Node.js’s Niche
How Node.js Applications Work
Aspects of Node.js Development
Installing Node.js
6. Commanding Databases
Introducing Elasticsearch
Creating a Command-Line Program in Node.js
with Commander
Using request to Fetch JSON over HTTP
Shaping JSON with jq
Inserting Elasticsearch Documents in Bulk
Implementing an Elasticsearch Query Command
Wrapping Up
→ Dan Scales
Principal Engineer, Google Inc.
Without the original Node.js the Right Way, I wouldn’t be where I
am today. This book leapfrogged me from being a casual Node.js
developer to loving the event loop and knowing how to build
effective distributed systems in Node.js. It led me to writing clean,
idiomatic, and highly understandable JavaScript—both in Node.js
and in the browser. This update will do the same for readers.
→ Kyle Kelley
Senior Software Engineer, Netflix
Jim’s update to his engaging, wide-ranging deep dive into how to
solve actual problems using Node.js taught even this old dog some
new tricks. Hats off to Jim for clearly demonstrating how to get the
most out of Node.js.
→ Mark Trostler
Software Engineer, Google Inc.
Jim Wilson shows the correct way, the way that will definitely make
you a better Node.js developer, giving you many techniques,
insights, and—most of all—some really cool stuff. Node.js 8 the Right
Way provides loads of good practices and reveals some of the lower-
level interactions of Node with the system. In a Node.js shop, this
book is a must for seniors’ reference and a must for new hires.
→ Peter Perlepes
Software Engineer, Growth
Acknowledgments
I’m so grateful to have had the opportunity to write this book. And
I’m especially thankful for my editor, Jackie Carter—your thoughtful
feedback made this book what it is today.
Thank you, dear reader, and readers of the Beta releases. Your
errata reports made the book better than it would have otherwise
been.
I’d also sincerely like to thank the whole team at The Pragmatic
Bookshelf. Thanks for your kind patience, and all of your hard work
to polish this book and find all of my mistakes.
The Right Way in this book’s title refers to both the process of
learning Node.js and the practice of writing Node.js code.
Learning Node.js
As with any growing technology, there are plenty of resources
available for learning Node.js. Unfortunately, many of those
resources are narrowly focused on serving up web resources.
The web is great, but it’s not enough, and it’s not the whole story of
Node.js. Node.js is about more than just serving web apps, and this
book treats it that way.
Node.js 8 the Right Way teaches you the concepts you’ll need to be
an effective Node.js programmer, no matter what kinds of programs
you need to write.
Writing Node.js
One thing I love about JavaScript is that there are seven ways to do
anything. There’s breathing room, where developers can explore and
experiment and find better approaches to everything.
Getting Started
Chapter 1, Getting Started, introduces the Node.js event loop,
explaining how it empowers Node.js to be highly parallel and single-
threaded at the same time. This chapter also outlines the five
aspects of Node.js development that frame each subsequent chapter
and has some brief instructions on getting Node.js installed on your
machine.
Commanding Databases
In Chapter 6, Commanding Databases, you’ll insert the extracted
Project Gutenberg catalog into an Elasticsearch index. To get this
done, you’ll write a command-line utility program called esclu using a
Node.js module called Commander. Since Elasticsearch is a RESTful,
JSON-based datastore, you’ll use the Request module to interact
with it. You’ll also learn to use a handy and powerful command-line
tool called jq for manipulating JSON.
Using Node-RED, you can quickly stub out exploratory HTTP APIs. I’ll
show you how!
MEAN
If you’re looking for an opinionated book that focuses only on a
particular stack like MEAN (Mongo, Express, Angular, and Node.js),
this is not it! Rather than prescribe a particular stack, I’ll teach you
the skills to put together the Node.js code, no matter which back
end you connect to or front end you choose to put on top.
I want you to be the best Node.js coder you can be, whether you
use any particular database or front-end framework.
c
onstlist = [];
for(leti = 1; i <= 100; i++) {
f(!(i % 15)) {
i
list.push('FizzBuzz');
} elseif(!(i % 5)) {
list.push('Buzz');
} elseif(!(i % 3)) {
list.push('Fizz');
} else{
list.push(i);
}
}
'
use strict'
;
constlist = [...Array(100).keys()]
.map(n => n + 1)
.map(n => n % 15 ? n : 'FizzBuzz'
)
.map(n => isNaN(n) || n % 5 ? n : 'Buzz'
)
.map(n => isNaN(n) || n % 3 ? n : 'Fizz'
);
When you write Node.js code, you should always handle errors and
exceptions, even if you just rethrow them. You’ll learn how to do this
throughout the book. However, some of the code examples lack
error handling. This is to aid readability and save space, and
sometimes to provide opportunities for reader tasks at the end of
the chapter. In your code, you should always handle your errors.
Online Resources
The Pragmatic Bookshelf’s page for this book is a great resource.[7]
You’ll find downloads for all the source code presented in this book,
and feedback tools, including a community forum and an errata-
submission form.
Thanks for choosing this book to show you Node.js the right way.
Jim R. Wilson
December 2017
Footnotes
[1] http://www.modulecounts.com/
[2] https://blog.risingstack.com/node-js-developer-survey-results-2016/
[3] https://facebook.github.io/react/
[4] https://angularjs.org/
[5] https://blog.codinghorror.com/why-cant-programmers-program/
[6] http://cygwin.com/
[7] http://pragprog.com/book/jwnode2/node-js-8-the-right-way
Getting Started
An old programming adage says that while functionality is an asset,
code is a liability.[8]
By the end, you’ll see where it’s possible to make great gains using
existing libraries, and where it makes sense to implement the
functionality yourself. At the end of the day, this wisdom is the
power that will distinguish you from a novice developer.
Thinking Beyond the web
A lot of the buzz around Node.js is focused on the web. In truth,
Node.js serves a bigger purpose that people often miss. Let’s use a
map to see where Node.js fits in the broader scheme of things.
Of the mercantile class I intend to say very little. So much that I have
just written applies with equal force to the Greens, or second estate
of the realm. I am often entertained by the leading merchants of
Tamarida and Zapyro, but these occasions really produce little more
than the exchange of polite formalities, and I know far less of these
persons than I do of the nobility. A portion of this class is connected
with the land in the form of yeomen, or small freeholders, whose
properties are however confined to Barbaria or to the poorer districts
of the Regio Solis. In their case the law of primogeniture is enforced
more strictly than amongst the landed aristocracy, for as the
yeoman's estate is reckoned insufficient to provide for all the males
of the family, only the eldest son enjoys the paternal acres. The
younger sons are accordingly dispatched to make their living or
fortune in some trade, and it is usually the stalwart young men of this
small landed stock who supply the greater part of the petty officers in
the army. The great majority of the Greens, as they are commonly
termed, are traders either on a large or a small scale, though a
certain number fill some of the lesser official posts of stewards and
assistants in connection with the work of the hierarchy. In the case of
members of this order who have amassed considerable wealth and
are desirous of entering the class of the nobles, application is made
to the council, and such appeals are either granted or refused after a
full hearing of the circumstances. The royal consent is likewise
necessary for the bestowal of this coveted privilege; and I may add
that such applications constitute the sole exception to the general
rule, that the nobles are never given to intrigue with myself. Naturally
they are jealous concerning the prerogative of their order, and some
at least are certain to resent fiercely any such attempts of outsiders
to be admitted to their ranks. A good many of such appeals are
rejected, but in the event of a successful application a large
contribution has to be paid to the coffers of the temple and the
palace; a landed estate has somehow to be purchased, usually in
Barbaria, and then the fortunate postulant doffs the green robes and
dons the red, which he is now permitted to wear, and also assumes
the use of a badge granted him by the King, who selects the emblem
he deems most suitable. The position of the new-comers for a
considerable time, perhaps for a couple of generations, is not an
enviable one, for they are treated coldly and looked at askance by
the majority of their fellow-nobles. But as the older folk pass away,
and memories grow shorter, the new lord, or rather his progeny,
becomes gradually absorbed by matrimonial connection into the
mass of the nobility, and intermingles with the rest. Still, the stigma of
having risen from the Greens clings, I fancy, to this type of pseudo-
aristocratic house for a long time. On the other hand, marriage with a
junior member of the nobility at once confers the husband's rank on
a bride of the second estate, who henceforth ceases to hold open
intercourse with her own family. Contrariwise, ladies of the nobility
who ally themselves with merchants or yeomen sink to the level of
their husbands' station.
With the populace again I have more intimacy and sympathy than
with the Greens, and through my attendants and bodyguard at the
palace I am brought more closely into touch with the people at large.
This third estate of the realm consists of all the manual labourers,
the artisans, the fisher-folk, and in short all such persons as live by
receiving wages, whether in money or kind. I have already hinted
that their condition and well-being form the constant care of the
councillors, who see that their homes are sanitary, well built and
generally adequate, whilst the wages paid must be deemed sufficient
to support the individual or his family in decency and comfort. In fact,
the supervision of this, the largest and economically the most
important section of the community, constitutes the first care of the
hierarchy. The people seem hale and happy, nor do they exhibit any
envy of the better-fed and better-clad Greens, nor yet of the majestic
and privileged Reds. The rules of family life prevail less strongly here
owing to the wider dispersal of its members, but they are nominally
identical with those in the classes above. There are no law courts in
Meleager, and usually disputes and difficulties in this class are
settled, as I have already shown, in the judgment hall of the capital,
where I sit on most days. The women-folk of the third estate live in
less seclusion than do those of the nobility and merchants, a result
that is due (as in our Mohammedan countries) to the necessity of the
poor having to perform their marketing and daily business in public.
This same class also may be said to include the numerous tribe of
indentured labourers, mostly from Barbaria, whose status somewhat
resembles that of the Roman slaves under the Empire. Vice and
drunkenness, though by no means unfrequent, are not conspicuous
in this class; whilst the police patrols keep a pretty sharp eye on the
landlords of the lower sort of wine-shop and brothel. These resorts of
the more dissipated of the people are also visited at times by the
councillors charged with their management and reputation, so that
the streets of Tamarida at night would compare favourably with those
of most European cities, and such debauchery as does exist is
assuredly kept well concealed behind doors and is not allowed to
offend the eyes or the ears of the passer-by in the streets, which,
though dark and narrow, can be safely traversed by all after nightfall.
A few cases of quarrelling and use of the knife occur and are
severely punished by the lash whenever the culprits are brought to
book; deliberate murder is very rare; theft is not frequent; assaults on
women and children are practically unknown. So far as my
observations tend, I can sum up without hesitation by saying that the
proletariat of Meleager is a remarkably happy, healthy, well-behaved,
industrious and sober body under what I may call the benign
despotism of councillors who have not only been educated to
command by years of special training, but also possess a natural gift
for such functions.
X
I should not like the reader from anything I have written hitherto to
carry away the impression that, because I am myself debarred from
their society, the women of Meleager own a status at all similar to
that prevailing in Mohammedan countries. On the contrary, setting
aside the exceptional case of their semi-divine monarch, the sex has
little to lament on the score of inferior or unfair treatment. The
Council of Seventy, it is true, contains no female element, but to
balance this, the college of the priestesses of the Sun, which I shall
describe presently, wields considerable powers in the government of
the state. Moreover, the severe restrictions concerning their relations
with the King rest, at least nominally, on religious grounds and would
therefore naturally be less likely to cause resentment. I think
therefore I had better first discuss the existing attitude of my female
subjects towards myself, for on this point I can at least offer some
correct and detailed information, both from personal knowledge and
as the result of inquiries I have from time to time cautiously ventured
to make of the older women, with whom alone I am permitted to hold
social intercourse.
No unimportant part of the religious training which every girl receives
at her mother's knee in Meleager is the Sun Myth, with its
picturesque fables of the Sun-god and his incarnated Child. The
divine nature and mission of the latter are always dwelt on by the
teacher with particular insistence and with due solemnity; and his
sanctity is described as placing him outside the pale of ordinary men
with ordinary passions. And not only this. Should the Child of the
Sun forget the sacred character of his entrusted mission to his
father's people and flout his father's precepts so far as to stoop to
philander with any maiden of his kingdom, not only will the
disobedient monarch incur his divine parent's grave displeasure, but
also a most terrible fate awaits the unhappy object of his attentions.
From this last portion of the advice instilled into the growing female
mind, I conclude that alarming scandals have actually occurred in
the past; and who can marvel at it? But how recent or remote are
these love intrigues in date; and how or where or when they were
detected and punished I am quite ignorant, nor am I ever likely to
receive enlightenment thereon. But it is also in harmony with my
theory of past troubles of this nature that a salutary story (which is by
no means regarded here as a legend) has long been in circulation.
The tale itself is strongly reminiscent of the old Greek myth of Zeus
and Semele, and in Meleager it takes the shape of an intrigue
between a foolish maiden of the people, Anata by name, and the
then reigning Child of the Sun, who fell a victim to her charms or her
advances. For it is gravely related that Anata actually made her way
to the private apartments of the King by stealth. Whether or no she
obtained any satisfaction from her forbidden interview will never be
known, but it is certain her body was found next morning in the royal
bed-chamber charred and almost unrecognisable as the dire result
of her clandestine embraces in the arms of the son of the God of
Fire. To become the mistress therefore of the Sun-child, should the
monarch descend so low as to forget his divine calling, is but the
certain prelude to an ignominious and horrible death; and such a
belief is firmly held by all women dwelling on Meleager. It is also
pronounced dangerous (as it is voted most decidedly immodest) for
any young woman, whether maiden or married, to allow even the
casual glance of the Sun-child to fall full on her face; so that it is
usual for all girls to fling the light veil, or mantilla, which every
Meleagrian woman wears, over her features in the event of her
encountering accidentally the person of the King. This custom,
however, is not an actual regulation, and I have often noticed girls,
especially those of the populace, indulge in a good solid stare as I
have come riding or walking down the streets of the capital, though
sooner or later some pretence of covering the eyes with the veil was
carried out. Amongst the nobility this formal hiding of the face is
more strictly insisted on, if only as a detail of good breeding. From
what I have seen, the young women of Meleager are short, dark and
comely, with fine brown merry eyes, small features, and dark hair. In
extreme youth they are often remarkably pretty and attractive, but
after child-birth they are very liable to lose their elegant symmetry,
and to find what was an agreeable plumpness exchanged for a
rather prominent bulkiness of figure.
I have never yet so much as spoken to a woman below the age of
thirty or thereabouts, and though the fundamental law forbidding my
intimacy with any woman in the pride and beauty of her youth is
quite wise and logical, according both to the letter and the spirit of
Meleagrian state craft, yet it is a rule that presses very cruelly upon
myself. For remember, I do not grow old and languid; my own vitality
is mysteriously renewed at short intervals, and male youth craves
the society and companionship of female youth; whilst also in my
case this natural desire can never diminish with the passing of the
years. In this respect I stand therefore betwixt the devil and the deep
sea, between Scylla and Charybdis. On the one hand, I have to curb
my juvenile longings and tastes which tend rather to grow stronger
and more insistent; whilst on the other, any attempt to circumvent
this ordinance of the hierarchy would not only end in my own
discomfiture, and possibly removal, but would most certainly result in
the miserable fate of any poor favourite of my choice. The story of
silly Anata's disgrace was not invented by the hierarchy merely to
serve as an empty fable, one may be sure of that. I feel convinced,
too, that the palace teems with spies for this very purpose of
thwarting any such intrigue, and though hitherto I have given no
cause even for suspicion, I feel my position most acutely. It is so
false, and I know it to be false, and so do those who have
manœuvred this particular piece of policy concerning their monarch.
When women have once exceeded the age of thirty (which is
considered the child-bearing limit in Meleager), and have
presumably lost all officially suspected attraction in the eyes of the
Child of the Sun, the embargo is removed, though there is never
much intercourse between the King and the middle-aged or elderly
ladies of the nobility. Whenever I honour the country home of one of
my nobles with my presence, all the young women of the household,
married or unmarried, are removed elsewhere, but such as are
above the fixed age of thirty are suffered to remain, though even in
these cases I note that I am seldom left alone with women, no matter
what their age. No doubt the female mind, so strongly imbued in
childhood with the inherent mystical terrors of their monarch, still
shrinks with awe from too close proximity with such a force of
potential danger. Possibly, however, I may err on this point, and in
reality some ancient notion of etiquette unknown to me is being
served by this noticeable self-effacement on the part of the older
women. Of course, the deference wherewith I am treated by the
male folk is intensified in the case of the ladies, who regard me much
in the same light that a bigoted Catholic would regard a tangible
apparition of St Peter or St Paul in their houses.
Politically, women possess no rights, but then no more do the men,
except the handful who compose the executive council, so they
cannot well complain of invidious treatment on this score, even were
they anxious to discover grievances of sex. As with the historic
Prussian queen, their empire admittedly lies in the nursery, for all
children are completely under the charge of their mothers according
to immemorial custom. In the nobility the tacit law seems to be that
the man is master outside the house, whilst the woman is mistress
within doors; and this maxim is generally acted upon throughout all
spheres of social life. Women are exempt from the poll-tax, which is
levied on all males, and indeed no taxes are exacted from women at
all, except in the rare and transitory instances of unmarried
heiresses of landed estates. Whether or no, vague, restless,
unsatisfied aspirations and longings occasionally assail the minds of
some of the younger men I cannot say for certain; but I do feel sure
that the womanhood of Meleager is absolutely satisfied with its
present lot and cannot so much as conceive of any betterment of
existing conditions. The conversations I have had with the wives or
sisters of my hosts at different times were usually of a rather stilted
and uninteresting nature; but I never failed to note their supreme
content and buoyant cheerfulness.
Nevertheless, although women have never been admitted into the
ranks of the hierarchy, and presumably never will be, yet they
possess a species of council of their own sex in the college of the
priestesses of the Sun, who inhabit a large block of buildings
contiguous to the great temple. This institution is based on rules
somewhat similar to those which prevail in the Council of the
Seventy, but it is worked and administered on broader lines, and the
age limit is not so strictly drawn as in the case of the hierarchy. Girls
who have no desire or vocation for matrimony may enter the portals
of this convent (if I may so term it) as novices; nor is the acceptance
of applicants confined to one social class, as is the rule concerning
the probationers of the hierarchy. On the contrary, a fair proportion of
the inmates of this convent are drawn from the middle and lower
classes, and thus the atmosphere of the convent is of a distinctly
democratic type. Even the highest office of all, that of Domina, or
lady abbess, is occasionally attained by a plebeian, for the rules of
election here are carefully compiled so as to secure the choice of the
most popular and capable of the candidates. The senior ladies of the
convent are kept in constant touch with the members of the council,
who frequently apply to the priestesses of the Sun for advice in
various matters of a social and remedial nature, which may be
deemed expedient. Thus all regulations concerning the welfare of
women and children have been carefully scrutinised and approved
by the Domina and her assessors before ever they are enforced by
the officials of the council. But how closely and on what lines the
temple and the convent work together is of course beyond my
knowledge, though it is evident that the two institutions are
conducted in apparent harmony with one another.
XI
It is scarcely fair to offer any comparison between the moral
progress as shown in Meleager and that prevailing on the Earth, and
in any case such a comparison would prove impossible, seeing how
varied and how complex are the many moral systems of the greater
planet. With our numerous nationalities it is only logical there should
result great diversities of opinion on ethics, and we are made to
realise our difficulty in estimating any average sum-total of earthly
morals to bring into the field of comparison. Has not one writer of
note averred that the views of sexual morality held by the phallic
worshippers of old and by the extreme Puritans of to-day rest equally
on a common religious foundation? And has not our British poet of
empire somewhere written that
"The wildest dreams of Kew are the facts of Khatmandù,
And the crimes of Clapham chaste in Martaban"?
In the instance of my own kingdom the many defunct and surviving
systems of the nations of the Earth have all been studied and have
doubtless been partially adapted here and there, so that in a sense
the Meleagrian outlook on morals is extremely interesting, as
affording the result of careful unprejudiced investigation over a wide
space of time. But of course the outcome of these secret researches
and deductions cannot possibly be agreeable or obvious to any one
people or set of thinkers on Earth, for it will be remembered that
whereas the Earth is a congeries of tribes and climates and faiths, so
Meleager is homogeneous, unless one takes into account the colder
and almost unexplored parts of Barbaria. And thus, as the
consequence of careful study for many, many generations by acute
well-trained intellects, a sort of eclecticism has been created here in
the field of morals, as has already arisen in the case of religious
tenets.
Here there are no hard and fast rules on moral behaviour, but each
individual is supposed to be guided by his or her instincts, which it is
considered expedient to depress or encourage, according to the
benefit or damage that may accrue thereby to society at large, or to
the state, if you prefer to regard it as such. The open exhibition of
harmful instincts then is looked on by the ruling caste of Meleager as
an occasion not for punishment but for segregation; such tendencies
in themselves being disregarded so long as they are practised in
secret and kept, as it were, under personal control. And here I am
speaking only of traits and tendencies, not of actual crimes, of fraud
or violence, for the punishment of which there exists a severe code
based apparently on the Mosaic laws. A cold-blooded murder is
repaid by a death penalty, which is carried out privately in the case of
a nobleman, by beheadal in prison of a merchant, and by public
hanging in the case of a plebeian. Crimes of assault are met with
strokes from the lash coupled with a fine; outrages on children are
punished by death. But vile crimes and executions are very rare
indeed, and this highly desirable state of things I attribute to the long
period wherein the rulers of Meleager have been gradually
eliminating the feeble-minded and evil-disposed members of the
community by their careful and judicious system of segregation.
Other cases of wrong-doing of a more venial type are usually met by
a scale of fines, which are intended to compensate the injured party
for any damage he may have incurred; whilst minor instances of
violence or disturbance of the peace are frequently punished by an
order to administer a certain number of lashes there and then in
open court, this penalty being not uncommonly awarded to drunken
or refractory persons belonging to the seafaring, peddling, long-
shore and such humbler sections of the populace.
Thanks again to the past measures taken to repress crime and to
ensure good behaviour, the physical health of the kingdom leaves
almost nothing to be desired. Epidemic diseases are practically
unknown, as are also contagious venereal maladies. It is the
constant, and possibly rather trying and officious, visitations made by
the sanitary inspectors into every homestead, small or great,
patrician or plebeian, which have doubtless helped to induce this
highly commendable condition of affairs. Disease and dirt are the
two evils which are attacked without rest or mercy by the councillors
appointed for their control, and by their equally energetic
representatives. Cleanliness is not reckoned as next to godliness in
Meleager; it is an inherent part of religion itself, and hygienic
regulations are perpetually being enforced upon what is now become
a willing, though no doubt in past times it was an unwilling,
population. I suppose many English Puritans would look askance at
the thermal establishments which exist both in the cities and in the
rural districts, seeing that the two sexes have here opportunities of
studying one another in a nude state; but then, as I have said before,
Meleagrian morals do not exist for morality's sake, but have
evidently been framed for the special purpose of securing a healthy
vigorous race. Early marriage is encouraged, but, paradoxical as it
may appear, large families are not considered desirable; whilst there
is a curious custom which permits of a husband no longer cohabiting
with his wife after she has borne him three children living. I have
heard that this eccentric, and no doubt to many offensive, notion also
prevails in the upper ranks of the civilised Latin races, though
possibly my informant may have been mistaken in his statement. I
gather that such a tacit understanding has its origin in the fear of
over-population, and certainly the limited land surface of Meleager
possessing a desirable climate may plead as a reasonable excuse
for the holding of this whimsical tenet, which seems to savour of the
school of Malthus. Apparently the growth of population in Meleager
is somewhat analogous to that of modern France, and seeing the
high place in which French philosophy and culture are held by the
leading nations of the Earth, the Meleagrians are at least erring in
good company.
Turning to the coarser side of the question of public morals,
prostitution exists, but neither to a great extent nor openly. Those
who can recall the nocturnal conditions of the main London
thorough-fares during the latter part of Queen Victoria's reign would
be agreeably surprised to detect no outward flaunting of vice after
dusk in the streets of Tamarida; and the least tendency to riot or
disturbance is promptly quelled by the military patrols. Not that
licence and debauchery do not abound, for there are, I believe,
plenty of resorts of a certain class in the towns; but the doings of
such places do not rise to the surface, and those who frequent them
dare not offend the quiet of their neighbours.
Meanwhile the priestesses of the Sun are constantly busied with the
ultimate fate of the harlot, and their emissaries are often engaged in
reclaiming girls from a licentious career and in training them to
become useful wives, for such early lapses are held lightly by the
mass of the people. And in not a few instances these "filles de joie"
become wedded to their paramours, and make good mothers. Such
an outlook is of course utterly unmoral to large sections of the
civilised and Christianised nations of Europe and America; but the
Meleagrian view is shared by many other races of the Earth who
have enjoyed a longer and perhaps a better record of civilisation
than have these complacent modern nations whose ancestors were
half-naked savages in the days of the Roman Empire. Universal
chastity, in short, is a feature almost exclusively confined to northern
tribes of barbarians, for whom it has great natural advantages
certainly, for it tends to breed a hardy and prolific race. But I do not
think it can be classed as a genuine virtue in itself, and it always
tends promptly to disappear the moment the trammels of education
and development are assumed. Now the Meleagrians can lay claim
to be an intensely civilised race, whereby I mean their rulers have
been engaged in the study of the arts of peace and progress for
many centuries, and have consequently left behind them the old
barbarian necessity for absolute chastity, though they still recognise
its value as a wholesome ingredient of married family life. For with
marriage chastity in their eyes takes on another aspect, which must
not be confounded with the former, and that is faithfulness. A
faithless wife is very rare indeed in Meleager, and her treatment at
the hands of her neighbours is not enviable.
XII
Religion has already entered so significantly into my narrative that I
feel I must apologise for a special dissertation on this subject. Yet I
have never so far described the exact nature or scope of the
Meleagrian faith which may be said to permeate and regulate the
whole private and public existence of the people.
The inhabitants of Meleager—and in the ensuing statements, of
course, I always except the hierarchy—are worshippers of the Sun,
who is their sole deity. He is visible to them for a large portion of
almost each day; he is tangible, in so far as they can feel the warmth
of his beams; he is alive and in constant motion, as they watch him
"ride the heavens like a horse" and disappear into the waters of the
western sea only to uprear again next morning above the eastern
horizon. As in the old Greek mythos, the Sun is popularly supposed
to drive his golden chariot with its flaming wheels and with its yoke of
fretting stallions across the dome of heaven, till finally god and car
alike pass over the containing rim of the Meleagrian world. Below the
flat surface of the land and sea the Sun-god inhabits a vast palace,
whose splendours far exceed anything known to men. Here he rests
after his daily labours amongst his numerous progeny, and refreshes
himself after his late exertions undertaken solely for the benefit of the
favoured race, that in the illimitable past he created in his own
image. The firmament is his field of action; the space below the
ground is his haven of retirement. At night the dome of heaven shorn
of his effulgent presence is lighted only by the sparkling stars;
"jewels of the Sun," as they are termed in Meleagrian parlance; or
else the great vacant arc is illumined by the sickly lustre of the Moon.
For the Moon stands to the Meleagrian mind, as it did largely to the
antique and mediæval imagination, for all that is uncanny and
malign. Few Meleagrians will walk abroad in clear moonlight, if they
can reasonably avoid so doing; and in the many tales and legends
that are current the Moon in her various phases and with her evil
influence always occupies a prominent place. The oldest legend
concerning the Moon, that is a legend parallel with such theories as
the origin of the rainbow or the story of the Ark on Mount Ararat of
the Jewish Pentateuch, relates how in the days of chaos there were
two Suns, rivals, who fought one another for the possession of the
beautiful world of Meleager; and that after a titanic combat, wherein
the heavens thundered and the mountains belched forth fire and
smoke, and the waters tossed and hissed furiously, the benign Sun
conquered and slew the opposing deity, whose dead body still floats
abroad in the sky, wherein it serves as an eternal trophy to the
prowess of the victor. In the popular imagination however the corpse
of the vanquished Moon is not wholly impotent for ill. A scintilla of
mischievous vitality is still believed to lurk in its form, during the
hours of the night, what time the Sun himself is absent from the
heavens. The average Meleagrian therefore has a peculiar dread of
the night, and of a moonlit night in a special degree. The practice of
magic, both of the black and white types, is fairly common in all
ranks of Meleagrian society, and its preparations and philtres are
always popularly associated with the period of the Moon's fulness,
when that deity's surviving spark of life is deemed most active.
The cult of the Meleagrians for the Sun not only recognises his vital
warmth and fructifying properties, but also attributes to him the
gathering or dispersal of the clouds which drop the refreshing rain
upon the thirsty soil and swell the opening buds of tree and plant.
The winds are also under the Sun's control, and are apparently
regarded as his offspring, who sometimes disobey their august
parent's injunctions, and either sportively or maliciously vex the
people of Meleager with unwelcome gales that imperil the fisher-folk
at sea, and injure the springing crops on land. But speaking broadly,
the Meleagrian is of St James's opinion that "every good gift and
every perfect gift is from above, and cometh down from the Father of
Lights with whom is no variableness neither shadow of turning." And
in truth the unchangeable benignity and faithfulness of the Sun-god
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.
textbookfull.com