How to use the file.cwd function in file

To help you get started, we’ve selected a few file examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebook / jest / packages / jest-config / src / vendor / jsonlint.js View on Github external
exports.main = function commonjsMain(args) {
  if (!args[1]) throw new Error('Usage: ' + args[0] + ' FILE');
  if (typeof process !== 'undefined') {
    var source = require('fs').readFileSync(
      require('path').join(process.cwd(), args[1]),
      'utf8',
    );
  } else {
    var cwd = require('file').path(require('file').cwd());
    var source = cwd.join(args[1]).read({charset: 'utf-8'});
  }
  return exports.parser.parse(source);
};
github zaach / jsonlint / lib / jsonlint.js View on Github external
exports.main = function commonjsMain(args) {
    if (!args[1])
        throw new Error('Usage: '+args[0]+' FILE');
    if (typeof process !== 'undefined') {
        var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
    } else {
        var cwd = require("file").path(require("file").cwd());
        var source = cwd.join(args[1]).read({charset: "utf-8"});
    }
    return exports.parser.parse(source);
}
if (typeof module !== 'undefined' && require.main === module) {
github jolira / site-manager / public / js / libs / handlebars / handlebars-1.0.beta.5-amdjs.js View on Github external
exports.main = function commonjsMain(args) {
            if (!args[1])
                throw new Error('Usage: '+args[0]+' FILE');
            if (typeof process !== 'undefined') {
                var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
            } else {
                var cwd = require("file").path(require("file").cwd());
                var source = cwd.join(args[1]).read({charset: "utf-8"});
            }
            return exports.parser.parse(source);
        }
        if (typeof module !== 'undefined' && require.main === module) {
github glowroot / glowroot / webresources / handlebars / src / main / resources / org / informantproject / webresources / handlebars / 1.0.0.beta.6 / handlebars.js View on Github external
exports.main = function commonjsMain(args) {
    if (!args[1])
        throw new Error('Usage: '+args[0]+' FILE');
    if (typeof process !== 'undefined') {
        var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
    } else {
        var cwd = require("file").path(require("file").cwd());
        var source = cwd.join(args[1]).read({charset: "utf-8"});
    }
    return exports.parser.parse(source);
}
if (typeof module !== 'undefined' && require.main === module) {
github IdeasNeverCease / hikari / system / logic / — / × / window / vendor / handlebars.js View on Github external
exports.main = function commonjsMain(args) {
    if (!args[1])
      throw new Error('Usage: ' + args[0] + ' FILE');
    var source, cwd;
    if (typeof process !== 'undefined') {
      source = require('fs').readFileSync(require('path').resolve(args[1]), "utf8");
    } else {
      source = require("file").path(require("file").cwd()).join(args[1]).read({
        charset: "utf-8"
      });
    }
    return exports.parser.parse(source);
  }
  if (typeof module !== 'undefined' && require.main === module) {

file

Higher level path and file manipulation functions.

MIT
Latest version published 10 years ago

Package Health Score

50 / 100
Full package analysis