You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/hub/README.md
+38-1Lines changed: 38 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,14 +117,51 @@ Checkout the demo: https://huggingface.co/spaces/huggingfacejs/client-side-oauth
117
117
118
118
The `@huggingface/hub` package provide basic capabilities to scan the cache directory. Learn more about [Manage huggingface_hub cache-system](https://huggingface.co/docs/huggingface_hub/en/guides/manage-cache).
119
119
120
+
### `scanCacheDir`
121
+
122
+
You can get the list of cached repository using the `scanCacheDir` function.
123
+
120
124
```ts
121
125
import { scanCacheDir } from"@huggingface/hub";
122
126
123
127
const result =awaitscanCacheDir();
124
128
125
129
console.log(result);
126
130
```
127
-
Note that the cache directory is created and used only by the Python and Rust libraries. Downloading files using the `@huggingface/hub` package won't use the cache directory.
131
+
Note: this does not work in the browser
132
+
133
+
### `downloadFileToCacheDir`
134
+
135
+
You can cache a file of a repository using the `downloadFileToCacheDir` function.
0 commit comments