Almost the same as {\ttfamily write\+File\+Sync} (i.\+e. it \href{http://pages.citebite.com/v2o5n8l2f5reb}{\texttt{ overwrites}}), except that if the parent directory does not exist, it\textquotesingle{}s created. {\ttfamily file} must be a file path (a buffer or a file descriptor is not allowed). {\ttfamily options} are what you\textquotesingle{}d pass to \href{https://nodejs.org/api/fs.html\#fs_fs_writefilesync_file_data_options}{\texttt{ {\ttfamily fs.\+write\+File\+Sync()}}}.


\begin{DoxyItemize}
\item {\ttfamily file} {\ttfamily $<$String$>$}
\item {\ttfamily data} {\ttfamily $<$String$>$ $\vert$ $<$Buffer$>$ $\vert$ $<$Uint8\+Array$>$}
\item {\ttfamily options} {\ttfamily $<$Object$>$ $\vert$ $<$String$>$}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_fs_extra_docs_outputFile_sync_autotoc_md11022}{}\doxysection{Example\+:}\label{md_sfcode_node_modules_fs_extra_docs_outputFile_sync_autotoc_md11022}

\begin{DoxyCode}{0}
\DoxyCodeLine{const fs = require('fs-\/extra')}
\DoxyCodeLine{}
\DoxyCodeLine{const file = '/tmp/this/path/does/not/exist/file.txt'}
\DoxyCodeLine{fs.outputFileSync(file, 'hello!')}
\DoxyCodeLine{}
\DoxyCodeLine{const data = fs.readFileSync(file, 'utf8')}
\DoxyCodeLine{console.log(data) // => hello! }

\end{DoxyCode}
 