Node js Recipes A Problem Solution Approach 1st Edition Cory Gackenheimer pdf download
Node js Recipes A Problem Solution Approach 1st Edition Cory Gackenheimer pdf download
https://ebookultra.com/download/node-js-recipes-a-problem-
solution-approach-1st-edition-cory-gackenheimer/
https://ebookultra.com/download/swift-recipes-a-problem-solution-
approach-1st-ed-edition-rogers/
https://ebookultra.com/download/r-recipes-a-problem-solution-
approach-1st-edition-larry-a-pace/
https://ebookultra.com/download/android-recipes-a-problem-solution-
approach-2nd-edition-dave-smith/
https://ebookultra.com/download/biztalk-2013-recipes-2nd-edition-a-
problem-solution-approach-mark-beckner/
Visual Basic 2008 Recipes A Problem Solution Approach 1st
Edition Rakesh Rajan
https://ebookultra.com/download/visual-basic-2008-recipes-a-problem-
solution-approach-1st-edition-rakesh-rajan/
https://ebookultra.com/download/wpf-recipes-in-c-2008-a-problem-
solution-approach-1st-edition-sam-bourton/
https://ebookultra.com/download/php-and-mysql-recipes-a-problem-
solution-approach-2nd-edition-frank-m-kromann/
https://ebookultra.com/download/asp-net-web-api-2-recipes-a-problem-
solution-approach-1st-edition-filip-wojcieszyn/
https://ebookultra.com/download/deploying-node-js-1st-edition-
pasquali/
Node js Recipes A Problem Solution Approach 1st
Edition Cory Gackenheimer Digital Instant Download
Author(s): Cory Gackenheimer
ISBN(s): 9781430260585, 1430260580
Edition: 1
File Details: PDF, 4.17 MB
Year: 2013
Language: english
www.it-ebooks.info
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
www.it-ebooks.info
Contents at a Glance
Index���������������������������������������������������������������������������������������������������������������������������������339
www.it-ebooks.info
Chapter 1
Understanding Node.js
Node.js is a server-side framework useful for building highly scalable and fast applications. Node.js is a platform
that is built on v8, the JavaScript runtime that powers the Chrome browser designed by Google. Node.js is designed
to be great for intensive I/O applications utilizing the nonblocking event-driven architecture. While Node.js can
serve functions in a synchronous way, it most commonly performs operations asynchronously. This means that as
you develop an application, you call events with a callback registered for handling the return of the function. While
awaiting the return, the next event or function in your application can be queued for execution. Once the first function
completes, its callback event is executed and handled by the function call that invoked the callback. This event-driven
processing is described in Node.js’s very own definition:
Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network
applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and
efficient, perfect for data-intensive real-time applications that run across distributed devices.
Applications written in Node.js are written in JavaScript, the ubiquitous language of the web platform. Because
of the accessibility of JavaScript to many experienced developers and newcomers alike, the Node.js platform and
community have taken off and have become critical parts of the development landscape for many companies and
developers.
This book is about Node.js. In particular this book is designed as a recipe book, which aims to provide a large set
of useful and high-quality examples of what Node.js is capable of accomplishing. This book is geared for a developer
who has some experience with JavaScript and at least some exposure to Node.js. By reading this book, you will gain
an understanding of many of the highly utilized modules, both those native to Node.js and those written by third-party
contributors, that are the main targets for Node.js developers.
This first chapter is a departure from the recipe format that will follow in the rest of the book. It is broken down
to get a developer up and running from scratch with installation and it gives an overview of how to function within
the Node.js platform. You will get an idea of how to install Node.js and understand many of the common paradigms
and the basic workflow to get a Node.js application running. As you will see, a considerable amount of time is spent
covering how Node.js works. Once you have read this chapter, you should be well equipped to dive into the recipes
in the chapters that follow.
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
Windows
On Windows, first download the .msi installer package. When you open the file, you will begin your walkthrough with
the Setup Wizard, shown in Figure 1-2.
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
As in most Windows applications, you will be presented with a default location to which you can install the
application files. This destination, however, can be overwritten and is presented to you as in Figure 1-3.
Figure 1-3. You can choose to use or overwrite the default file location
The last step before finalizing your install on Windows is to set up any custom configurations that you may want
for your Node.js installation. For example you could not add Node.js to your path; perhaps you want to test multiple
versions and will explicitly call the executable during your testing phase. This custom step is shown in Figure 1-4.
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
OS X
The installer on a Macintosh is very similar to the Windows setup. First, download the .pkg file. When you open this,
it will walk you through the standard installer that runs on OS X. This presents as you see in Figure 1-5.
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
Sometimes when installing Node.js, you want only a subset of the potential users to be able to access it.
This functionality is built into the OS X installer, presenting you with the option of how you would like Node.js
installed, as shown in Figure 1-6.
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
Just as on Windows, you can customize the installation. Click the Custom Install button and then set your
configuration accordingly as shown in Figure 1-7. For example, you may wish not to install npm, in favor of doing
a more customized npm install, which we will outline in the next section.
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
There are, of course, many platforms that are not Macintosh or Windows, but you would still like to not have to
download and compile Node.js from sources. The solution for this is to find a package manager that will install Node.
js for you. There are several package management systems that vary across platforms, each with its own style for
fetching new packages.
You can then proceed with the installation by adding the repository that hosts Node.js, updating your sources,
and installing with the commands shown in Listing 1-2.
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
Fedora
Fedora 18 has a simple Node.js install that is a single package manager directive, as shown in Listing 1-3.
In future versions of Fedora, Node.js should be integrated within the operating system by default.
Arch Linux
For Arch Linux, utilize the pacman package manager by targeting the “nodejs” package, as shown in Listing 1-4.
openSUSE
When using openSUSE you can install Node.js using the zypper command-line package management tool,
as shown in Listing 1-6.
Many developers prefer utilizing package managers on OS X and even Windows as opposed to utilizing the
installers. Node.js can also be installed via these package managers.
Windows
Using the Chocolatey package manager, simply install with the chocolatey command, as shown in Listing 1-7.
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
OS X
Whether you utilize MacPorts or Homebrew for your package manager on Macintosh, you can install Node.js in either
case as shown in Listings 1-8 and 1-9.
At this point you should have Node.js installed on your machine by using the method of your choosing on your
preferred platform. Next, you need to make sure you have a way to discover and manage Node.js packages.
You could also set configuration parameters with the npm install script, shown in Listing 1-11.
Of course, you could build a patch for npm, in which case you will be best served to download from the GitHub
source and build it yourself. This requires running the make command in the folder that you have downloaded the
npm source to (see Listing 1-12).
With npm installed your machine is now set up to utilize the packages and modules that are easily accessed
through this package utility.
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
Module Context
1. In a module, there is a free variable “require”, which is a function.
a. The “require” function accepts a module identifier.
b. “require” returns the exported API of the foreign module.
c. If there is a dependency cycle, the foreign module may not have finished executing
at the time it is required by one of its transitive dependencies; in this case, the object
returned by “require” must contain at least the exports that the foreign module has
prepared before the call to require that led to the current module’s execution.
d. If the requested module cannot be returned, “require” must throw an error.
2. In a module, there is a free variable called “exports” that is an object that the module may
add its API to as it executes.
3. Modules must use the “exports” object as the only means of exporting.
Module Identifiers
1. A module identifier is a string of “terms” delimited by forward slashes.
2. A term must be a CamelCase identifier: “ . ”, or “ . . ”.
3. Module identifiers may not have file-name extensions like “.js”.
4. Module identifiers may be “relative” or “top-level.” A module identifier is “relative”
if the first term is “ . ” or “ . . ”.
5. Top-level identifiers are resolved off the conceptual module namespace root.
6. Relative identifiers are resolved relative to the identifier of the module in which “require”
is written and called.
10
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
You can now examine what a simple implementation of a CommonJS module would look like. Assume you
create a file called “describe.js,” which will export a string of text that responds with a description of the module
shown in Listing 1-13.
This module does not require any other modules to function; all that it does is export the describe function,
which returns a string description. But this is very uninteresting and if you wish to include this module within
your applications elsewhere, you need to install that module in your code. To do this, use the CommonJS require( )
function, as shown in Listing 1-14.
Now you have a reference to your describe module, but what does that mean? What happens when you call
require( )? When you call require( ), Node.js will locate the resource and read and parse the file, granting you access
to the exported API of the module. When Node.js loads the file into your application, it will automatically isolate the
module into its own scoped namespace to prevent global names colliding in a disastrous thunder of crying. Because
Node.js has loaded this resource for you, you can call exported functionality from this resource (see Listing 1-15).
console.log(describeModule.describe());
CommonJS modules are not entirely about exporting functionality either. They can be used to create an API that
builds on functionality with the module’s file but leaves that functionality private to the module itself. Imagine you
have a more robust module where only a certain portion of your module needs to be exposed; you can easily create
a method for this “private” functionality and still see it in the exported solution, as in Listing 1-16.
exports.describe = function() {
return 'I am a ' + _getType();
};
11
www.it-ebooks.info
Chapter 1 ■ Understanding Node.js
You will see more about authoring and consuming CommonJS modules later, but, for now, the important
takeaway is how this all works. CommonJS modules export functionality, and only the explicitly exported functionality
is exported. Other functions or methods may live with the CommonJS modules, but they are limited to the private
scope of the module itself and not to the application that accesses the module. This can result in very clean APIs for
your application if you are careful and structure your CommonJS modules appropriately.
Understanding how Node.js implements the CommonJS methodology for module loading helps you to think
creatively about the structure and API of your application, allows for code sharing and reuse, and makes your
application code cleaner and easier to follow.
var db = require('./db.js');
12
www.it-ebooks.info
Exploring the Variety of Random
Documents with Different Content
development of home manufactures, the reclamation of many waste
spaces through the operation of enclosure Acts, and the
improvements brought about in cultivation. The need for better
means of communication in order to open up districts then more or
less isolated, to provide better transport for raw materials and
manufactured goods, and to facilitate the carriage of domestic and
other supplies needed by the increasing population, thus became
more and more apparent.
"Although, through the uncertainty of its stream, the Wye was never
brought to answer the purpose of a regular conveyance, its
navigation has proved of great service throughout the county of
Hereford. Throughout the last[21] century most of the coal
consumed in Hereford and its neighbourhood was brought up in
barges after a flood. Various other heavy articles, such as grocery,
wines and spirits, having been first conveyed from Bristol to
Brockweir in larger vessels, were carried up thence in barges at a
much easier rate than by land carriage. In return the boats were
freighted with the valuable oak timber, bark, cider, wheat, flour and
other produce of the county. The opening of the towing-path for
horses by the Act of 1809 gave a further impetus to navigation, and
especially to the trade in coal from Lidbrook, and while every river-
side village could boast of its quay and its barge, the quay walls at
Hereford were thronged with loading and unloading barges....
Oliver Cromwell had other matters than roads and rivers to engage
his attention, and Francis Mathew got from him no favourable
response to his proposals. But in 1670 he dedicated to Charles II.
and "the Honorable Houses of Parliament" a new edition of his
scheme under the title of "A Mediterranean Passage by Water from
London to Bristol, and from Lynne to Yarmouth, and so consequently
to the City of York for the great Advancement of Trade and
Traffique." In the course of his Dedication he said:—
"I hear some say, You projected the making Navigable the River
Stoure in Worcestershire; what is the reason it was not finished? I
say it was my projection, and I will tell you the reason it was not
finished. The River Stoure and some other Rivers were granted by
an Act of Parliament to certain Persons of Honour, and some
progress was made in the work; but within a small while after the
Act passed it was let fall again. But it being a brat of my own I was
not willing it should be Abortive; therefore I made offers to perfect
it, leaving a third part of the Inheritance to me and my heirs for
ever, and we came to an agreement. Upon which I fell on, and made
it compleatly navigable from Sturbridge to Kederminster; and carried
down many hundred Tuns of Coales, and laid out near one thousand
pounds, and then it was obstructed for Want of Money, which by
Contract was to be paid."
Liverpool was thus shut off from communication with the interior by
river, and for a long time the town was not in a much better position
as regards roads. No Roman road came nearer to Liverpool than
Warrington, and, down to 1750 (as I have already shown), the road
between Warrington and Liverpool was not passable for coaches or
carriages. On the east Liverpool was practically isolated from the rest
of the country by the high range of hills dividing Lancashire from
Yorkshire, and there were the still more formidable hills of the Lake
District on the north. The early route for a journey to the south from
Liverpool was to cross the Mersey at Monk's Ferry, Birkenhead, and
then pass through the forest of Wirral to Chester. Here there was
found a Roman road, along which a coach to London was running in
the reign of James II. (1685-1688), whereas the first coach from
Warrington to London did not start until 1757.
So long as our commercial relations were mainly with Continental or
other ports which could be more conveniently reached from the east
or the south coast, or from Bristol, and so long as the industries of
Lancashire and Yorkshire were but little developed, or found an
outlet abroad in these other directions, the comparative isolation of
Liverpool was a matter of no great national concern; though how, in
effect, Liverpool compared with other seaports or river-ports in the
thirteenth century is shown by the fact (as told by Thomas Baines, in
his "History of the Commerce and Town of Liverpool") that whereas
the aggregate value of trading property in Liverpool, Lancaster,
Preston and Wigan—the only four towns in Lancashire which then
acknowledged possessing such property at all—was given in an
official return for the year 1343 as £233, equal to £3495 of our
present money; the equivalent value to-day of the trading property
of Bristol at the same period would be £30,000, and that of
Nottingham, then the great inland port of the Trent, £50,000.
That was a time when, as the same authority says, "Liverpool stood
nearly at the extremity of the known world." But when the known
world was enlarged by the addition thereto of the New World of
America, and when commerce with the lands across the Atlantic
began to develop, and the industries of Lancashire and Yorkshire to
grow apace, the need for improved communications with the port of
Liverpool became more and more acute.
Such need was the greater, too, because of the fate that was
overtaking the much earlier and hitherto far more prosperous port of
Chester. Established as a fortress of the first order by the Romans, at
the western end of one of their famous roads, and favoured alike by
Saxons and Normans, Chester had developed into a flourishing
commercial port from which, more especially, intercourse with
Ireland was conducted, and it was still the port through which
travellers passed to or from Ireland for a long time after Liverpool
began to compete actively for the Irish goods traffic. Richard Blome,
who visited Chester in 1673, describes it in his "Britannia" as "the
usual place for taking shipping for Ireland, with which it has a very
great intercourse, and a place of very considerable trade."
It was not until the passing of the Mersey and Irwell Navigation Act,
in 1720, that the work of rendering these rivers navigable between
Warrington and Manchester was begun, and another twenty years
elapsed before it was completed. The result of this "conveniency of
water carriage" when it was, at last, obtained, was to reduce the
cost of transport of goods and merchandise from forty shillings a ton
by road to ten shillings a ton by river. The goods traffic between
Liverpool and Manchester at this time amounted to about 4000 tons
a year; but it had, prior to the provision of water transport, naturally
been restricted to the quantity that could be carried by the
packhorses, carts and waggons of those days. Hence the river
navigation gave the advantage of a transport not only cheaper in
price but greater in capacity. It will be seen later on, however, that
the Mersey and Irwell navigation subsequently developed
disadvantages for which a remedy was sought in the construction of
the Duke of Bridgewater's canal.
An Act, passed in 1720, for making the river Weaver navigable from
Winsford Bridge, beyond Northwich, to Frodsham Bridge, near the
junction of the Weaver with the Mersey (a distance of about twenty
miles), was not only of further material advantage to the port of
Liverpool but a first step in an important development of the salt
mines of Cheshire. These mines have been described as
"incomparably the richest of the salt mines and brine pits of
England"; but at the date in question their working was greatly
hampered by transport costs and difficulties in the matter both of
fuel and of the distribution of the salt, when made.
Fuel was required for heating the furnaces and the pans in which the
brine was evaporated into salt; and in the earliest days of the
industry the salt-makers used for this purpose faggots of wood
brought from the forests on the borders of Cheshire and
Staffordshire. As long as these supplies were available, the principal
seat of the salt trade was at Nantwich, in the higher part of the
Weaver, and near to the forests where the wood was obtained. But
the forests got depleted in course of time, and the industry then
moved to other works lower down the river which could be operated
with coal brought from the Lancashire coal-field. This coal, however,
had to be carried, by cart or packhorse, a distance of twelve or
fourteen miles; and inasmuch as two tons of coal were required for
every three tons of fine salt made, the cost of transport of raw
materials was a serious item.
As for the manufactured salt, that was distributed in the same way,
even such small consignments as could then alone be sent to
Liverpool having to be taken thither by road. In the circumstances
the salt trade remained comparatively undeveloped in Cheshire while
it was making great advance at Newcastle-on-Tyne, where the coal
readily obtained, by water, from the neighbouring coal-fields was
used in the production of salt from sea-water. In the time of the
Stuarts the manufacture of salt was one of the most important of
Newcastle's industries and articles of export.
When, under the Act of 1720, the Weaver was made navigable as far
as the Northwich and Winsford Bridge salt works, the land journey
for Lancashire coal was reduced from twelve or fourteen miles to
five or six miles, and the salt could be sent direct to Liverpool by
water. The greatest impetus to the Cheshire salt industry (to the
consequent detriment, and eventual extinction, of that at Newcastle-
on-Tyne, though with a further advantage to the trade of Liverpool)
was, however, not given until the makers were enabled to get their
coal all the way by water through the supplementing of the now
navigable Weaver by the Sankey Canal—of which more hereafter.
In the same year that the Act for improving the navigation of the
Weaver was passed, Parliament sanctioned a no less important work
on the river Douglas, which passes through Wigan, and has its outlet
in the Ribble estuary, at a point about nine miles west of Preston.
Wigan is situated on a part of the Lancashire coal-fields which
contains some of the richest and most valuable seams of coal to be
found in Lancashire; but down to 1720 the only means of
distributing this coal was by cart or packhorse. The opening of the
Douglas to navigation allowed of the coal being sent by water to the
estuary of the Ribble, and thence forwarded up the Ribble to
Preston, or, alternatively, along the coast either to Lancaster in the
one direction or to Liverpool and Chester in the other. These were
tedious routes, and the voyage from the Ribble estuary along the
coast was often very dangerous on account both of storms and of
sand-banks. The lines of water communication were, nevertheless,
so much cheaper than land carriage that they were followed for
about fifty years—until a safer and more expeditious waterway was
provided through the opening of the Leeds and Liverpool Canal.[22]
Thomas Baines, from whose "History of the Town and Commerce of
Liverpool" I glean these details, adds:—
"With all its defects, the Douglas navigation may be regarded as the
primary cause of the manufacturing prosperity of the town of
Preston, which it was the first means of supplying with cheap fuel
for its workshops and factories. It may, also, be considered as one of
the early causes of the commercial prosperity of Liverpool, which has
always been much promoted by the possession of cheap and
abundant supplies of coal and salt."
The chief reason why the bleak and barren moorlands of the north
were preferred to the fair and fertile plains of the south for the
further expansion of these great national industries was that, in the
days when the steam-engine of James Watt was as yet far off, the
heavier rainfall in the English Highlands of the north and north-west,
together with the more numerous streams pouring down mountain
sides both of greater height and of greater extent than in the south,
gave to the cloth-makers, not only the abundant water supply they
wanted, but, also, the particular kind of motive power, through the
use of water-wheels, on which they then mainly relied for the
working of their machinery.
It was in the interests of this power derived from falling water that
the textile industries first migrated from the eastern counties—where
the streams flow but slowly, and from comparatively slight elevations
—to the western counties, where there are streams coming from
hills of from 800 to 1000 feet in height. These, for a time, answered
better the desired purpose, though only to be more or less
discarded, in turn, for northern or north-western streams which, with
a greater rainfall, had their rise on heights of from 1500 to 2000
feet, and were so numerous that almost every one of the "small"
manufacturers who set up business for himself on the otherwise
cheerless slope of a Yorkshire hill-side could have a brook, a rivulet,
or a mountain torrent of his own, or, at least, make abundant use of
one before it passed on to serve the purposes of his neighbour.
In the early stage of this transition period the streams were desired
and utilised solely as an aid to manufacturing purposes. As the
towns or the industrial centres developed, however, there grew up
increasing need for improved means of transport—supplementary to
the roads of that day—in order, more especially, to facilitate the
better distribution of the commodities then being produced in ever-
increasing quantities. It was this need that led to the Act of 1699,
giving powers for rendering the Aire and the Calder navigable.
Petitions in favour thereof were presented by the "clothiers" (as
cloth-makers were then called) of various towns likely to derive
advantage from the scheme, and some of these petitions afford an
interesting insight into the conditions under which the cloth industry
was carried on in Yorkshire and Lancashire in the closing years of
the seventeenth century.
"This Demand for Beef is occasioned thus: the usage of the People is
to buy in at that Season Beef sufficient for the whole Year which
they kill and salt, and hang up in the Smoke to dry. This way of
curing their Beef keeps it all the Winter, and they eat this smoak'd
Beef as a very great Rarity.
"Upon this foot 'tis ordinary for a Clothier that has a large Family, to
come to Halifax on a Market Day, and buy two or three large
Bullocks from eight to ten Pounds a-piece. These he carries home
and kills for his Store. And this is the reason that the markets at all
those times of the Year are thronged with Black Cattle, as Smithfield
is on a Friday, whereas all the rest of the year there is little
extraordinary sold there."
The supplies intended for home use were distributed in this manner:
Leeds was the head-quarters of a body of merchants who were in
the habit of going all over England with droves of packhorses loaded
up with the cloth which had been bought in the open-air market, as
already described. These travelling merchants did not sell to
householders, since that would have constituted them pedlars. They
kept to the wholesale business, dealing only with shopkeepers in the
towns or with traders at the fairs; but they operated on such a scale
that, Defoe says, "'tis ordinary for one of these men to carry a
thousand pounds value of Cloth with them at a time, and having sold
it at the Fairs or Towns where they go, they send their Horses back
for as much more, and this very often in the Summer, for they chuse
to travel in the summer, and perhaps towards the Winter time, tho'
as little in Winter as they can, because of the badness of the Roads."
Other of the buyers on the Leeds market sent their purchases to
London, either carrying out commissions from London traders or
forwarding on consignment to factors and warehousemen who
themselves supplied wholesale and retail dealers in London, besides
despatching great quantities of coarse goods abroad, especially to
New England, New York, Virginia, etc. The Russian merchants in
London also sent "an exceeding quantity" to St Petersburg, Riga,
Sweden, Dantzic and Pomerania.
It was mainly on account of this London and foreign trade that the
Act for making the rivers Aire and Calder navigable was obtained,
there being secured a waterway communication by means of which
the cloth could be sent direct from Leeds, Wakefield and other
industrial centres to Hull, there to be shipped to London or to
Continental ports, as desired.
How the cutlers of Sheffield and the steel manufacturers and others
of Hallamshire in general had been accustomed to forward their
goods by road to the inland port of Bawtry, thence to be sent down
the Idle and on by the Trent and the Humber to Hull, has already
been told. (See pp. 123-4.) There came a time, however, when this
preliminary land journey of twenty miles from Sheffield to Bawtry
was found of great disadvantage to the trade of the district; and in
1697 leave was given to bring in a Bill to allow of the Don, already
navigable to Doncaster, being rendered navigable to Sheffield, in
order that merchandise might be sent by that stream direct from
Sheffield to the Ouse, and so on to the Humber and the port of Hull.
But the opposition offered by representatives of the Bawtry, Trent
and other interests—who rightly foresaw in the scheme impending
ruin for most of the traffic on the Idle—was so powerful that the Bill
was thrown out. A further Bill, with a like object, was introduced,
and strongly supported, in the following Session. It was still more
vigorously opposed, there being what Hunter describes as "a war of
petitions," and it was not proceeded with.
For a time nothing further was done; but in the meanwhile Sheffield
was rapidly advancing to the position of one of the leading industrial
centres in the country, and the compulsory twenty-mile journey by
road to the chief port of consignment for Sheffield goods sent to
London or abroad when there was a river flowing through Sheffield
itself, was felt to be an intolerable infliction, as well as a serious
prejudice to the local industries.
In 1722, therefore—twenty-four years after the last of the earlier
attempts—the Master Cutler of Sheffield and the Cutlers' Company
petitioned Parliament to allow the improvement of the Don
navigation to proceed. The corporation of Doncaster sent a like
petition, and so did the corporations of Manchester, Stockport and
several other places. But the established interests still controlled the
situation, and the design once more failed.
Four years later (1726) the Sheffield cutlers made still another effort,
and this time, although the opposition was again very powerful, it
was agreed in Committee of the House of Commons that power
should be given to the Cutlers' Company to make the Don navigable
from Doncaster, not to Sheffield itself, but to Tinsley, three miles
from Sheffield; and, also, to maintain a turnpike road from Sheffield
to Tinsley. A Bill to this effect was passed, and in 1727 the
corporation of Doncaster obtained powers to remove certain
obstructions from the Don; but, under an Act of 1732, the carrying
out of the whole scheme was transferred to an independent body,
the Company of Proprietors of the River Don Navigation. It proved,
says Hunter, writing in 1828, "eminently beneficial to the country";
but the reader will see that the Sheffield cutler or manufacturer still
had to forward his goods three miles by road before they could be
sent, first along the Don, then along the Ouse, then down the
Humber to Hull, and then (if they were consigned to London) by sea
along the east coast, and finally up the Thames to the Metropolis.
These were the conditions until the year 1821, when the three-mile
journey by road was saved by the opening of a canal between
Sheffield and the Don at Tinsley, affording, as was said, "easy
accommodation with the coast and London."
CHAPTER XV
It will have been assumed, from the two preceding chapters, that
rivers, whether naturally navigable or rendered navigable by art,
were of material service in supplementing defective roads, in
opening up to communication parts of the country that would then
otherwise have remained isolated, and in aiding the development of
some of the greatest of our national industries.
While this assumption is well founded, yet, as time went on, the
unsatisfactory nature of much of the inland river navigation in this
country became more apparent.
Some of the greatest troubles arose from, on the one hand, excess
of water in the rivers owing to floods, and, on the other, from
inadequate supplies of water due either to droughts or to shallows.
Area of Tributaries.
Basin. United
Name. County.
Length. sq. length.
Miles. miles. No. miles.
Humber York 37 1229 2 55
Mersey Lancaster 68 1707 6 188
Nen Northampton 99 1055 1 11
Ouse York 59½ 4207 11 629
Ouse Cambridge 156¼ 2894 8 212
Severn Gloucester 178 4437 17 450
Thames — 201¼ 5162 15 463
In the matter of high tides, "Rees' Cyclopædia" (1819) says that the
tide "often" rises at the mouth of the Wye to a height of 40 ft.; while
"Chambers' Encyclopædia" gives 47 ft. above low-water mark as the
height to which the tide has been known to rise in the same river at
Chepstow.
"A principal defect of the present conveyance arises from the shoals
in the river Severn above Worcester, an evil incurable. The fall from
Stourport to Diglis, near Worcester, is nineteen feet; and the river is,
what this fact alone would prove, full of shoals. These shoals impede
the current of the stream, and retain the water longer in the bed of
the river. Let these shoals be removed, the water will pass off, and
the whole of the river become too shallow for navigation. Locks on
the river could alone correct this defect; but these would overflow
the meadows, impede the drainage of the land, and do an injury to
the landowners, which parliament can never sanction.
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.
ebookultra.com