Skip to content

Commit 98d6adc

Browse files
committed
update readme, add exports
1 parent 17e8706 commit 98d6adc

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ If `output_dir` is not provided, it's assumed equal to `source_dir`. This is use
113113
### Node.js API
114114

115115
```js
116-
const tinyjam = require('tinyjam');
116+
import tinyjam from 'tinyjam';
117117

118118
tinyjam(sourceDir, outputDir, {
119119
log: false, // log the progress (like in the CLI)
@@ -123,6 +123,8 @@ tinyjam(sourceDir, outputDir, {
123123
});
124124
````
125125

126+
Note that the project only supports Node v12.17+.
127+
126128
## FAQ
127129

128130
#### Why build yet another static site generator?
@@ -172,8 +174,8 @@ Do all the preprocessing in the source directory prior to running `tinyjam`.
172174
Here's an example using the `tinyjam` API with [highlight.js](https://highlightjs.org/):
173175

174176
```js
175-
const tinyjam = require('tinyjam');
176-
const {highlight} = require('highlight.js');
177+
import tinyjam from 'tinyjam';
178+
import {highlight} from 'highlight.js';
177179
178180
tinyjam(sourceDir, outputDir, {
179181
highlight: (code, lang) => highlight(lang, code).value

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "A zero-configuration static site generator that deliberately has no features",
44
"main": "index.js",
55
"type": "module",
6+
"exports": "./index.js",
67
"bin": {
78
"tinyjam": "./cli.js"
89
},

0 commit comments

Comments
 (0)