NotePlan / NotePlan/plugins

New DataStore.fileExists(pathname) API call

Open
#402 3 comments 0 reactions 1 assignee View on GitHub

@EduardMe is already working on this.

Since Feb 4, 2023.

API E-1 enhancement P-3
Dominant language
JavaScript
Stars
204
Forks
82
Avg merge
22h 27m
Merged PRs (30d)
3

Description

Now that we're using shared libraries, we could do with a way to check files are present. Currently we have to use .loadData(pathname) to check for this. Some of these files (react and fonts) are quite large, and we're concerned about the time it takes to load them just to test if they are there and throw the loaded file away. Better to have a DataStore.fileExists(pathname) call, which would be nearly instantaneous.

[edit to add] More importantly, I now realise, it avoids an error being thrown, which currently is what happens if pathname doesn't exist.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.