Tabnine Logo For Javascript
stat
Code IndexAdd Tabnine to your IDE (free)

How to use
stat
function
in
fs

Best JavaScript code snippets using fs.stat(Showing top 15 results out of 3,546)

origin: Flood-UI/flood

fs.stat(filePath, (err, stats) => {
 if (err) return next(err);
origin: GoogleChromeLabs/ndb

await Promise.all(files.map(file => new Promise(done => fs.stat(file, (err, stats) => {
 if (err) {
  done();
origin: reactide/reactide

fs.stat(filePath, (err, stats) => {
 if (err) {
origin: reactide/reactide

fs.stat(filePath, (err, stats) => {
 if (err) {
origin: DavidAnson/markdownlint

const configFile = file.replace(/\.md$/, ".json");
let mergedConfig = null;
const actualPromise = fs.promises.stat(configFile)
 .then(
  function configFileExists() {
origin: richardgirges/express-fileupload

describe('Test Single File Upload with useTempFiles option and empty tempFileDir.', function() {
 const app = server.setup({ useTempFiles: true, tempFileDir: '' });

 mockFiles.forEach((fileName) => {
  const filePath = path.join(fileDir, fileName);
  const uploadedFilePath = path.join(uploadDir, fileName);
  const result = genUploadResult(fileName, filePath);

  it(`upload ${fileName} with POST`, function(done) {
   clearUploadsDir();
   request(app)
    .post('/upload/single')
    .attach('testFile', filePath)
    .expect(resetBodyUploadData)
    .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done)));
  });    
 });
});
origin: welkinwong/nodercms

fs.stat(path.join(__dirname, '../public/themes/' + directory), function (err, stats) {
  if (err) {
   err.type = 'system';
   return callback(err);
  }

  if (stats && stats.isDirectory()) {
   viewEngine(app, directory);

   callback(null);
  } else {
   var err = {
    type: 'system',
    error: directory + '目录不存在或非法'
   };

   callback(err);
  }
 });
origin: welkinwong/nodercms

options.findOne({ name: 'siteInfo' }, function (err, siteInfo) {
  if (err) {
   err.type = 'database';

   return callback(err);
  }

  (function checkDirectory (directory) {
   fs.stat(path.join(__dirname, '../public/themes/' + directory), function (err, stats) {
    if (stats && stats.isDirectory()) {
     viewEngine(app, directory);

     callback();
    } else {
     if (directory !== 'default') {
      checkDirectory('default');
     } else {
      callback(directory + '目录不存在或非法');
     }
    }
   });
  })(_.get(siteInfo, 'value.theme') || 'default');
 });
origin: tus/tus-js-client

return new Promise((resolve, reject) => {
 const name = path.resolve(file.path);
 fs.stat(file.path, (err, info) => {
  if (err) {
   return reject(err);
origin: o2team/athena

waitCount++;
fs.stat(it, function(e, stat) {
  waitCount--;
origin: richardgirges/express-fileupload

   return done(err);
  fs.stat(filePath, done);
 });
});
origin: welkinwong/nodercms

fs.stat(path.join(__dirname, '../../install.lock'), function(err, stat) {
  if (err && err.code == 'ENOENT') {
   return callback(null, false);
  } else if (err) {
   err.type = 'system';
   return callback(err);
  }

  if (stat.isFile()) {
   hasInstall = true;

   callback(null, true);
  } else {
   var err = {
    type: 'system',
    error: 'install.lock 非文件,请检查'
   };
   callback(err);
  }
 });
origin: richardgirges/express-fileupload

.end((err) => {
 if (err) return done(err);
 fs.stat(uploadedFilesPath[0], (err) => {
  if (err) return done(err);
  fs.stat(uploadedFilesPath[1], (err) => {
   if (err) return done(err);
   fs.stat(uploadedFilesPath[2], done);
  });
 });
origin: richardgirges/express-fileupload

   .field('email', mockUser.email)
   .expect(resetBodyUploadData)
   .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done)));
 });
   .field('email', mockUser.email)
   .expect(resetBodyUploadData)
   .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done)));
 });    
});
origin: richardgirges/express-fileupload

describe('Test Single File Upload w/ .mv()', function() {
 const app = server.setup();

 mockFiles.forEach((fileName) => {
  const filePath = path.join(fileDir, fileName);
  const uploadedFilePath = path.join(uploadDir, fileName);
  const result = genUploadResult(fileName, filePath);

  it(`upload ${fileName} with POST w/ .mv()`, function(done) {
   clearUploadsDir();
   request(app)
    .post('/upload/single')
    .attach('testFile', filePath)
    .expect(resetBodyUploadData)
    .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done)));
  });

  it(`upload ${fileName} with PUT w/ .mv()`, function(done) {
   clearUploadsDir();
   request(app)
    .post('/upload/single')
    .attach('testFile', filePath)
    .expect(resetBodyUploadData)
    .expect(200, result, err => (err ? done(err) : fs.stat(uploadedFilePath, done)));
  });
 });
});
fsstat

JSDoc

Asynchronous stat(2) - Get file status.

Most used fs functions

  • readFileSync
    Synchronously reads the entire contents of a file.
  • existsSync
    Synchronously tests whether or not the given path exists by checking with the file system.
  • readFile
    Asynchronously reads the entire contents of a file.
  • readdirSync
    Synchronous readdir(3) - read a directory.
  • writeFile
    Asynchronously writes data to a file, replacing the file if it already exists.
  • createReadStream,
  • createWriteStream,
  • Stats.isDirectory,
  • statSync,
  • mkdirSync,
  • unlinkSync,
  • unlink,
  • ReadStream.pipe,
  • readdir,
  • Stats.isFile,
  • WriteStream.on,
  • ReadStream.on,
  • Stats.size

Popular in JavaScript

  • minimatch
    a glob matcher in javascript
  • ws
    Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
  • colors
    get colors in your node.js console
  • request
    Simplified HTTP request client.
  • fs
  • aws-sdk
    AWS SDK for JavaScript
  • path
  • commander
    the complete solution for node.js command-line programs
  • minimist
    parse argument options
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now