\href{https://travis-ci.org/justmoon/node-extend}{\texttt{ }} \href{https://david-dm.org/justmoon/node-extend}{\texttt{ }} \href{https://david-dm.org/justmoon/node-extend\#info=devDependencies}{\texttt{ }}\hypertarget{md_sfcode_node_modules_extend_README_autotoc_md10023}{}\doxysection{extend() for Node.\+js $<$sup$>$$<$a href=\char`\"{}https\+://npmjs.\+org/package/extend\char`\"{}$>$$<$img src=\char`\"{}http\+://versionbadg.\+es/justmoon/node-\/extend.\+svg\char`\"{} alt=\char`\"{}\+Version Badge\char`\"{}/$>$$<$/a$>$$<$/sup$>$}\label{md_sfcode_node_modules_extend_README_autotoc_md10023}
{\ttfamily node-\/extend} is a port of the classic extend() method from j\+Query. It behaves as you expect. It is simple, tried and true.

Notes\+:


\begin{DoxyItemize}
\item Since Node.\+js $>$= 4, \href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign}{\texttt{ {\ttfamily Object.\+assign}}} now offers the same functionality natively (but without the \char`\"{}deep copy\char`\"{} option). See \href{https://nodejs.org/en/docs/es6}{\texttt{ ECMAScript 2015 (ES6) in Node.\+js}}.
\item Some native implementations of {\ttfamily Object.\+assign} in both Node.\+js and many browsers (since NPM modules are for the browser too) may not be fully spec-\/compliant. Check \href{https://www.npmjs.com/package/object.assign}{\texttt{ {\ttfamily object.\+assign}}} module for a compliant candidate.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_extend_README_autotoc_md10024}{}\doxysubsection{Installation}\label{md_sfcode_node_modules_extend_README_autotoc_md10024}
This package is available on \href{https://npmjs.org/package/extend}{\texttt{ npm}} as\+: {\ttfamily extend}


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install extend }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_extend_README_autotoc_md10025}{}\doxysubsection{Usage}\label{md_sfcode_node_modules_extend_README_autotoc_md10025}
{\bfseries{Syntax\+:}} extend $\ast$$\ast$($\ast$$\ast$ \mbox{[}{\ttfamily deep}\mbox{]}, {\ttfamily target}, {\ttfamily object1}, \mbox{[}{\ttfamily objectN}\mbox{]} $\ast$$\ast$)$\ast$$\ast$

{\itshape Extend one object with one or more others, returning the modified object.}

{\bfseries{Example\+:}}


\begin{DoxyCode}{0}
\DoxyCodeLine{var extend = require('extend');}
\DoxyCodeLine{extend(targetObject, object1, object2); }

\end{DoxyCode}


Keep in mind that the target object will be modified, and will be returned from extend().

If a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s). Undefined properties are not copied. However, properties inherited from the object\textquotesingle{}s prototype will be copied over. Warning\+: passing {\ttfamily false} as the first argument is not supported.\hypertarget{md_sfcode_node_modules_extend_README_autotoc_md10026}{}\doxysubsubsection{Arguments}\label{md_sfcode_node_modules_extend_README_autotoc_md10026}

\begin{DoxyItemize}
\item {\ttfamily deep} {\itshape Boolean} (optional) If set, the merge becomes recursive (i.\+e. deep copy).
\item {\ttfamily target} {\itshape Object} The object to extend.
\item {\ttfamily object1} {\itshape Object} The object that will be merged into the first.
\item {\ttfamily objectN} {\itshape Object} (Optional) More objects to merge into the first.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_extend_README_autotoc_md10027}{}\doxysubsection{License}\label{md_sfcode_node_modules_extend_README_autotoc_md10027}
{\ttfamily node-\/extend} is licensed under the \href{http://opensource.org/licenses/MIT}{\texttt{ MIT License}}.\hypertarget{md_sfcode_node_modules_extend_README_autotoc_md10028}{}\doxysubsection{Acknowledgements}\label{md_sfcode_node_modules_extend_README_autotoc_md10028}
All credit to the j\+Query authors for perfecting this amazing utility.

Ported to Node.\+js by \href{https://github.com/justmoon}{\texttt{ Stefan Thomas}} with contributions by \href{https://github.com/insin}{\texttt{ Jonathan Buchanan}} and \href{https://github.com/ljharb}{\texttt{ Jordan Harband}}. 