Gathering detailed insights and metrics for output-file-sync
Gathering detailed insights and metrics for output-file-sync
Gathering detailed insights and metrics for output-file-sync
Gathering detailed insights and metrics for output-file-sync
sync-runner
To execute a binary executable file and return its standard output synchronization.
cy-i18n-sync-cli
sync-i8n [--way <tier|tile>] [--file-type <json|properties>] [--output src/locale] [--registry http://xxx]-p xxx
@puppedo/walk-sync
Synchronously walks through a directory and its subdirectories, returning an array of file paths.
fs-iconv
save file with charset/encoding/iconv
Synchronously write a file and create its ancestor directories if needed
npm install output-file-sync
Typescript
Module System
Node Version
NPM Version
98.8
Supply Chain
98.9
Quality
75.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
393,481,959
Last Day
86,171
Last Week
366,851
Last Month
1,931,570
Last Year
30,247,780
15 Stars
44 Commits
1 Forks
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
2.0.1
Package Id
output-file-sync@2.0.1
Size
3.46 kB
NPM Version
5.6.0
Node Version
9.5.0
Publised On
15 Feb 2018
Cumulative downloads
Total Downloads
Last day
1.3%
86,171
Compared to previous day
Last week
-16.1%
366,851
Compared to previous week
Last month
-1.2%
1,931,570
Compared to previous month
Last year
-4.4%
30,247,780
Compared to previous year
3
7
Synchronously write a file and create its ancestor directories if needed
1const {readFileSync} = require('fs'); 2const outputFileSync = require('output-file-sync'); 3 4outputFileSync('foo/bar/baz.txt', 'Hi!'); 5readFileSync('foo/bar/baz.txt', 'utf8'); //=> 'Hi!'
This module is very similar to fs-extra's fs.outputFileSync
method, but different in the following points:
1const {statSync} = require('fs'); 2const outputFileSync = require('output-file-sync'); 3 4outputFileSync('foo/bar', 'content', {mode: 33260}); 5statSync('foo').mode; //=> 33260
npm install output-file-sync
1const outputFileSync = require('output-file-sync');
path: string
data: string
, Buffer
or Uint8Array
options: Object
(options for fs.writeFileSync and mkdirp) or string
(encoding)
Return: string
if it creates more than one directories, otherwise null
It writes the data to a file synchronously. If ancestor directories of the file don't exist, it creates the directories before writing the file.
1const {statSync} = require('fs'); 2const outputFileSync = require('output-file-sync'); 3 4// When the directory `foo/bar` exists 5outputFileSync('foo/bar/baz/qux.txt', 'Hello', 'utf-8'); 6 7statSync('foo/bar/baz').isDirectory(); //=> true 8statSync('foo/bar/baz/qux.txt').isFile(); //=> true
It returns the directory path just like mkdirp.sync:
Returns the first directory that had to be created, if any.
1const dir = outputFileSync('foo/bar/baz.txt', 'Hello'); 2dir === path.resolve('foo'); //=> true
All options for fs.writeFileSync and mkdirp are available.
Additionally, you can pass fileMode
and dirMode
options to set different permission between the file and directories.
Set the mode of a file, overriding mode
option.
Set the modes of directories, overriding mode
option.
1outputFileSync('dir/file', 'content', {dirMode: '0745', fileMode: '0644'}); 2fs.statSync('dir').mode.toString(8); //=> '40745' 3fs.statSync('dir/file').mode.toString(8); //=> '100644'
ISC License © 2017 - 2018 Shinnosuke Watanabe
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
branch protection not enabled on development/release branches
Details
Reason
38 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More