Add example to readme
This commit is contained in:
parent
da04862aad
commit
29ea947b41
13
README.md
13
README.md
|
@ -17,6 +17,19 @@ Features that have yet to be implemented but are planned:
|
||||||
- Improved file slug/id handling
|
- Improved file slug/id handling
|
||||||
- Plugin API
|
- Plugin API
|
||||||
|
|
||||||
|
## Example Usage
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
import { Vault } from "@foundry/hammerstone";
|
||||||
|
|
||||||
|
const vault = new Vault("./my-vault");
|
||||||
|
vault.process((document) => {
|
||||||
|
document.setFrontmatter({ "Last Processed": Date.now() });
|
||||||
|
});
|
||||||
|
|
||||||
|
vault.write();
|
||||||
|
```
|
||||||
|
|
||||||
## API
|
## API
|
||||||
|
|
||||||
### `new Vault(vaultRootPath)`
|
### `new Vault(vaultRootPath)`
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@foundry/hammerstone",
|
"name": "@foundry/hammerstone",
|
||||||
"version": "0.2.0",
|
"version": "0.3.0",
|
||||||
"description": "Load and manipulate Obsidian vault data",
|
"description": "Load and manipulate Obsidian vault data",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": "./bin/hammerstone.js",
|
"exports": "./bin/hammerstone.js",
|
||||||
|
|
Loading…
Reference in a new issue