@jsvfs/adapter-noop
Advanced tools
Comparing version 0.1.0 to 1.0.0
10
index.js
"use strict"; | ||
/** | ||
* If you're looking to use `jsvfs`, you're best to start with `@jsvfs/core`. | ||
* | ||
* This module is the default noop backend for `jsvfs` and probably already imported if you have installed `@jsvfs/core`. | ||
* | ||
* If you're looking to create new adapters, please use `@jsvfs/types` and look to `@jsvfs/adapter-node-fs` as an example. | ||
* [[include:packages/adapter-noop/README.md]] | ||
* @packageDocumentation | ||
@@ -22,5 +18,3 @@ * @module @jsvfs/adapter-noop | ||
/** Snapshot of the underlying file system; an asynchronous iterable which returns an entry of path and data. | ||
* @param {string} [path='/'] - The current path as the tree is descended. | ||
* @param {boolean} [read=true] - Whether to retrieve the underlying data. | ||
* @returns {AsyncGenerator<[string, 'folder' | Buffer]>} The asynchronous iterable to get the snapshot. | ||
* @returns {AsyncGenerator<[string, SnapshotEntry]>} The asynchronous iterable to get the snapshot. | ||
*/ | ||
@@ -27,0 +21,0 @@ async *snapshot() { } |
16
index.ts
/** | ||
* If you're looking to use `jsvfs`, you're best to start with `@jsvfs/core`. | ||
* | ||
* This module is the default noop backend for `jsvfs` and probably already imported if you have installed `@jsvfs/core`. | ||
* | ||
* If you're looking to create new adapters, please use `@jsvfs/types` and look to `@jsvfs/adapter-node-fs` as an example. | ||
* [[include:packages/adapter-noop/README.md]] | ||
* @packageDocumentation | ||
@@ -11,3 +7,3 @@ * @module @jsvfs/adapter-noop | ||
import type { Adapter, ItemType, JournalEntry } from '@jsvfs/types' | ||
import type { Adapter, ItemType, JournalEntry, LinkType, SnapshotEntry } from '@jsvfs/types' | ||
@@ -31,7 +27,5 @@ /** An adapter for No-Operation; essentially makes the VFS a memory-only instance. */ | ||
/** Snapshot of the underlying file system; an asynchronous iterable which returns an entry of path and data. | ||
* @param {string} [path='/'] - The current path as the tree is descended. | ||
* @param {boolean} [read=true] - Whether to retrieve the underlying data. | ||
* @returns {AsyncGenerator<[string, 'folder' | Buffer]>} The asynchronous iterable to get the snapshot. | ||
* @returns {AsyncGenerator<[string, SnapshotEntry]>} The asynchronous iterable to get the snapshot. | ||
*/ | ||
async *snapshot (): AsyncGenerator<[string, 'folder' | Buffer]> {} | ||
async * snapshot (): AsyncGenerator<[string, SnapshotEntry]> {} | ||
@@ -45,3 +39,3 @@ /** Create a file or write the contents of a file to persistent storage. */ | ||
/** Create a link in persistent storage. */ | ||
async link (from: string, to: string, type: 'hardlink' | 'softlink'): Promise<void> {} | ||
async link (from: string, to: string, type: LinkType): Promise<void> {} | ||
@@ -48,0 +42,0 @@ /** Remove items from persistent storage. */ |
{ | ||
"name": "@jsvfs/adapter-noop", | ||
"version": "0.1.0", | ||
"version": "1.0.0", | ||
"description": "The default adapter for `@jsvfs/core`.", | ||
@@ -31,5 +31,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"@jsvfs/types": "^0.1.0" | ||
"@jsvfs/types": "^1.0.0" | ||
}, | ||
"gitHead": "25737f4baff0381b19b30a5d28baf8bf0240d1cc" | ||
"gitHead": "ef491e036b549ca1684d66bca9d15c08ff783c44" | ||
} |
@@ -1,8 +0,24 @@ | ||
# @jsvfs/adapter-noop | ||
# JSVFS Adapter: No-op | ||
The default adapter for `jsvfs`. Useful for testing or for using `jsvfs` purely in-memory with no access to persistent storage. | ||
If you're looking to use `jsvfs`, it's probably best to start with `@jsvfs/core`. | ||
This module is the default noop backend for `jsvfs` and already imported if you have installed `@jsvfs/core`. | ||
If you're looking to create new adapters, please use `@jsvfs/types` and look to [`@jsvfs/adapter-node-fs`](https://ahuggins-nhs.github.io/jsvfs/modules/_jsvfs_adapter_node_fs.html) as an example. | ||
## Supported Features | ||
- Async commits: nope. | ||
- Pass-through reads: nada. | ||
- Snapshots: nay. | ||
- Flush: nein. | ||
- Journaling: 番号 | ||
😀 Because everything is a no-op! | ||
## Installation | ||
Get it from npm: | ||
Get it from [npm](https://www.npmjs.com/package/@jsvfs/adapter-noop): | ||
```shell | ||
@@ -9,0 +25,0 @@ npm install --save @jsvfs/adapter-noop |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
31
4988
79
+ Added@jsvfs/types@1.0.0(transitive)
- Removed@jsvfs/types@0.1.0(transitive)
Updated@jsvfs/types@^1.0.0