How to use the realpath function from fs-extra

Find comprehensive JavaScript fs-extra.realpath code examples handpicked from public code repositorys.

212
213
214
215
216
217
218
219
220
221
after(async () => {
  await fs.unlink(linkDir);
});

it(`making sure link exists at ${linkDir}`, async () => {
  const realPath = await fs.realpath(linkDir);
  expect(realPath).to.equal(root);
});

runIntegrationTests(root, linkDir, start, file);
fork icon7
star icon86
watch icon2

+ 51 other calls in file

236
237
238
239
240
241
242
243
244
245
- fs.mkdtemp():创建一个临时目录
- fs.open():设置文件模式
- fs.readdir():读取目录的内容
- fs.readFile():读取文件的内容。有关:fs.read()
- fs.readlink():读取符号链接的值
- fs.realpath():将相对文件路径指针(.,..)解析为完整路径
- fs.rename():重命名文件或文件夹
- fs.rmdir():删除文件夹
- fs.stat():返回由传递的文件名标识的文件的状态。相关阅读:fs.fstat(),fs.lstat()
- fs.symlink():创建指向文件的新符号链接
fork icon0
star icon12
watch icon1

+ 13 other calls in file

284
285
286
287
288
289
290
291
292
293
}
const configOverride = {
  kontinuousPath: {
    env: "KS_KONTINUOUS_PATH",
    default: path.resolve(
      `${path.dirname(await fs.realpath(process.argv[1]))}/..`
    ),
  },
  version: {
    generate: () => version,
fork icon0
star icon7
watch icon6

+ 14 other calls in file

21
22
23
24
25
26
27
28
29
30
31
32


Import.param("importID", async (req, res, next) => {
  const blogImportDirectory = await fs.realpath(
    join(tempDir, "import", req.blog.id)
  );
  const userSuppliedImportDirectory = await fs.realpath(
    join(tempDir, "import", req.blog.id, req.params.importID)
  );


  if (!userSuppliedImportDirectory.startsWith(blogImportDirectory)) {
fork icon69
star icon0
watch icon23

+ 9 other calls in file

26
27
28
29
30
31
32
33
34
35
  os.tmpdir(),
  `vercel-${Date.now()}-${Math.floor(Math.random() * 100)}`
);
await fs.ensureDir(workPath);

workPath = await fs.realpath(workPath);
console.log('building in', workPath);

const buildResult = await builder.build({
  files: inputFiles,
fork icon0
star icon0
watch icon2

+ 22 other calls in file

177
178
179
180
181
182
183
184
185
186
187
// futimes
// lutimes


// // PATHS
// access
// fs.realpath(__dirname, (err, result) => { _log(result) })
// fstat
// lstat
// stat
// exists
fork icon0
star icon0
watch icon0

+ 9 other calls in file

function icon

fs-extra.readFileSync is the most popular function in fs-extra (9724 examples)