Writes an object to a JSON file.

{\bfseries{Alias\+:}} {\ttfamily write\+JSONSync()}


\begin{DoxyItemize}
\item {\ttfamily file} {\ttfamily $<$String$>$}
\item {\ttfamily object} {\ttfamily $<$Object$>$}
\item {\ttfamily options} {\ttfamily $<$Object$>$}
\begin{DoxyItemize}
\item {\ttfamily spaces} {\ttfamily $<$Number$\vert$\+String$>$} Number of spaces to indent; or a string to use for indentation (i.\+e. pass `'\textbackslash{}t\textquotesingle{}{\ttfamily for tab indentation). See \mbox{[}the docs\mbox{]}(\href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify}{\texttt{ https\+://developer.\+mozilla.\+org/en-\/\+US/docs/\+Web/\+Java\+Script/\+Reference/\+Global\+\_\+\+Objects/\+JSON/stringify}}\#The\+\_\+space\+\_\+argument) for more info. -\/}EOL$<$\+String$>${\ttfamily Set EOL character. Default is}~\newline
{\ttfamily . -\/}replacer{\ttfamily \mbox{[}JSON replacer\mbox{]}(\href{https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify}{\texttt{ https\+://developer.\+mozilla.\+org/en-\/\+US/docs/\+Web/\+Java\+Script/\+Reference/\+Global\+\_\+\+Objects/\+JSON/stringify}}\#The\+\_\+replacer\+\_\+parameter)}
\item {\ttfamily Also accepts \mbox{[}}fs.\+write\+File\+Sync\`{} options\mbox{]}(\href{https://nodejs.org/api/fs.html\#fs_fs_writefilesync_file_data_options}{\texttt{ https\+://nodejs.\+org/api/fs.\+html\#fs\+\_\+fs\+\_\+writefilesync\+\_\+file\+\_\+data\+\_\+options}})
\end{DoxyItemize}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_fs_extra_docs_writeJson_sync_autotoc_md11043}{}\doxysection{Example\+:}\label{md_sfcode_node_modules_fs_extra_docs_writeJson_sync_autotoc_md11043}
\hypertarget{md_sfcode_node_modules_fs_extra_docs_writeJson_sync_autotoc_md11044}{}\doxysection{@code\{js\}}\label{md_sfcode_node_modules_fs_extra_docs_writeJson_sync_autotoc_md11044}
const fs = require(\textquotesingle{}fs-\/extra\textquotesingle{})

fs.\+write\+Json\+Sync(\textquotesingle{}./package.json\textquotesingle{}, \{name\+: \textquotesingle{}fs-\/extra\textquotesingle{}\}) 

{\bfseries{See also\+:}} \mbox{\hyperlink{md_sfcode_node_modules_fs_extra_docs_outputJson_sync}{\`{}output\+Json\+Sync()\`{}}} 