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

How to use path

Best JavaScript code snippets using path(Showing top 15 results out of 23,697)

origin: clinicjs/node-clinic

async function uploadData (uploadURL, authToken, filename, opts) {
 // filename may either be .clinic-doctor.html or the data directory
 // .clinic-doctor
 const filePrefix = path.join(filename).replace(/\.html$/, '')
 const isPrivate = opts && opts.private

 console.log(`Uploading data for ${filePrefix} and ${filePrefix}.html`)

 const result = await tarAndUploadPromisified(path.resolve(filePrefix), uploadURL, authToken, { private: isPrivate })

 result.url = `${uploadURL}${result.html}`
 return result
}
origin: cube-js/cube.js

(process.env.NODE_PATH || '')
 .split(path.delimiter)
 .filter(folder => folder && !path.isAbsolute(folder))
 .map(folder => path.resolve(appDirectory, folder))
 .join(path.delimiter)
origin: doramart/DoraCMS

async didLoad() {
    // 数据模型初始化
    var modelsPath = path.resolve(__dirname, './app/model');
    this.app.initExtendModel(modelsPath);
  }
origin: eggjs/egg

app.beforeStart(function*() {
  // dumpConfig() dynamically
  json = readJSON(path.join(baseDir, 'run/application_config.json'));
  assert(json.config.dynamic === 1, 'should dump in config');
  json = readJSON(path.join(baseDir, 'run/agent_config.json'));
  assert(json.config.dynamic === 0, 'should dump in config');

  yield sleep(2000);
  app.config.dynamic = 2;
 });
origin: GoogleChromeLabs/ndb

beforeAll(async function(state) {
  const DEVTOOLS_DIR = path.dirname(
    require.resolve('chrome-devtools-frontend/front_end/shell.json'));
  const frontendFolder = await fsMkdtemp(path.join(os.tmpdir(), 'ndb-test-frontend-'));
  await new ReleaseBuilder([
   path.join(__dirname, '..', 'front_end'),
   DEVTOOLS_DIR,
   path.join(__dirname, '..'),
   path.join(__dirname, '..', '..', '..')
  ], frontendFolder).buildApp('integration_test_runner');
  state.frontendFolder = frontendFolder;
 });
origin: hua1995116/webchat

const mkdirsSync = function(dirname) {
 if (fs.existsSync(dirname)) {
   return true;
 }
 if (mkdirsSync(path.dirname(dirname))) {
   fs.mkdirSync(dirname);
   return true;
 }
}
origin: nodejs/nodejs.org

function renderPost (results) {
 const templateStr = fs.readFileSync(path.resolve(__dirname, 'release.hbs')).toString('utf8')
 const template = Handlebars.compile(templateStr, { noEscape: true })
 const view = Object.assign({
  date: new Date().toISOString(),
  versionSlug: slugify(results.version)
 }, results)

 return Object.assign({
  content: template(view)
 }, results)
}
origin: Flood-UI/flood

loadDatabase() {
  if (this.isDBReady) return;

  const db = new Datastore({
   autoload: true,
   filename: path.join(config.dbPath, this.user._id, 'settings', 'feeds.db'),
  });
  this.isDBReady = true;
  return db;
 }
origin: GoogleChromeLabs/ndb

pkg() {
  // TODO(ak239spb): implement it as decorations over package.json file.
  try {
   return require(path.join(fileURLToPath(this._info.cwd), 'package.json'));
  } catch (e) {
   return null;
  }
 }
origin: cube-js/cube.js

async getFiles(dir, fileList = []) {
  const files = await fs.readdir(path.join(this.localPath(), dir));
  // eslint-disable-next-line no-restricted-syntax
  for (const file of files) {
   const stat = await fs.stat(path.join(this.localPath(), dir, file));
   if (stat.isDirectory()) {
    fileList = await this.getFiles(path.join(dir, file), fileList);
   } else fileList.push(path.join(dir, file));
  }
  return fileList;
 }
origin: DavidAnson/markdownlint

// Run markdownlint the same way the corresponding repositories do

tape("https://github.com/eslint/eslint", (test) => {
 const rootDir = "./test-repos/eslint-eslint";
 const globPatterns = [ join(rootDir, "docs/**/*.md") ];
 const configPath = join(rootDir, ".markdownlint.yml");
 lintTestRepo(test, globPatterns, configPath);
});
origin: DavidAnson/markdownlint

tape("https://github.com/mkdocs/mkdocs", (test) => {
 const rootDir = "./test-repos/mkdocs-mkdocs";
 const globPatterns = [
  join(rootDir, "README.md"),
  join(rootDir, "CONTRIBUTING.md"),
  join(rootDir, "docs/*"),
  "!" + join(rootDir, "docs/CNAME")
 ];
 const configPath = join(rootDir, ".markdownlintrc");
 lintTestRepo(test, globPatterns, configPath);
});
origin: Flood-UI/flood

loadDatabase() {
  if (this.ready) return;

  const db = new Datastore({
   autoload: true,
   filename: path.join(config.dbPath, this.user._id, 'notifications.db'),
  });

  this.ready = true;

  return db;
 }
origin: doramart/DoraCMS

async didLoad() {
    // 数据模型初始化
    var modelsPath = path.resolve(__dirname, './app/model');
    this.app.initExtendModel(modelsPath);
  }
origin: Flood-UI/flood

(process.env.NODE_PATH || '')
 .split(path.delimiter)
 .filter(folder => folder && !path.isAbsolute(folder))
 .map(folder => path.resolve(appDirectory, folder))
 .join(path.delimiter)
path

Most used path functions

  • PlatformPath.join
  • PlatformPath.resolve
  • PlatformPath.basename
  • PlatformPath.relative
  • PlatformPath.isAbsolute
  • PlatformPath.extname,
  • PlatformPath.delimiter,
  • join,
  • resolve,
  • PlatformPath.sep,
  • basename,
  • PlatformPath.parse,
  • ParsedPath.name,
  • relative,
  • PlatformPath.normalize,
  • isAbsolute,
  • delimiter,
  • dirname,
  • extname

Popular in JavaScript

  • aws-sdk
    AWS SDK for JavaScript
  • ws
    Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js
  • node-fetch
    A light-weight module that brings window.fetch to node.js
  • colors
    get colors in your node.js console
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • lodash
    Lodash modular utilities.
  • mkdirp
    Recursively mkdir, like `mkdir -p`
  • cheerio
    Tiny, fast, and elegant implementation of core jQuery designed specifically for the server
  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • Top plugins for Android Studio
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