Skip to content

Commit c9851f8

Browse files
committed
add package.json and readme for js template
1 parent 0d964f2 commit c9851f8

File tree

3 files changed

+84
-1
lines changed

3 files changed

+84
-1
lines changed

templates/template-js/README.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# {name}
2+
3+
## Overview
4+
5+
{description}
6+
7+
## Loading
8+
9+
### In browser
10+
11+
```html
12+
<script src="https://unpkg.com/@jspsych-timelines/{name}">
13+
```
14+
15+
### Via NPM
16+
17+
```
18+
npm install @jspsych-timelines/{name}
19+
```
20+
21+
```js
22+
import { createTimeline, timelineUnits, utils } from "@jspsych-timelines/{name}"
23+
```
24+
25+
## Compatibility
26+
27+
`@jspsych-timelines/{name}` requires jsPsych v7.0.0 or later.
28+
29+
## Documentation
30+
31+
### createTimeline
32+
33+
#### {globalName}.createTimeline(jsPsych, { *options* }) ⇒ <code>timeline</code>
34+
Description of the timeline that this plugin generates
35+
36+
The following parameters can be specified in the **options** parameter.
37+
38+
| Parameter | Type | Default | Description |
39+
|-----------|------|---------|-------------|
40+
| parameter | type | default | description |
41+
42+
43+
### timelineUnits
44+
45+
46+
### utils
47+
48+
## Author / Citation
49+
50+
{author}

templates/template-js/package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "@jspsych-timelines/{name}",
3+
"version": "0.0.1",
4+
"description": "{description}",
5+
"unpkg": "dist/index.browser.min.js",
6+
"files": [
7+
"index.js",
8+
"dist"
9+
],
10+
"scripts": {
11+
"build": "babel index.js --presets @babel/preset-env,minify --source-maps --out-file dist/index.browser.min.js",
12+
"build:watch": "npm run build -- --watch"
13+
},
14+
"repository": {
15+
"type": "git",
16+
"url": "git+https://github.com/jspsych/jspsych-timelines.git",
17+
"directory": "packages/{name}"
18+
},
19+
"author": {
20+
"name": "{author}",
21+
"url": "{authorUrl}"
22+
},
23+
"license": "MIT",
24+
"bugs": {
25+
"url": "https://github.com/jspsych/jspsych-timelines/issues"
26+
},
27+
"homepage": "https://github.com/jspsych/jspsych-timelines/tree/main/packages/{name}",
28+
"devDependencies": {
29+
"@jspsych/config": "^2.0.0",
30+
"jspsych": "^7.0.0"
31+
}
32+
}
33+

templates/template-ts/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"main": "dist/index.mjs",
77
"types": "dist/index.d.ts",
8-
"unpkg": "dist/index.global.js",
8+
"unpkg": "dist/index.browser.min.js",
99
"scripts": {
1010
"build": "tsup src/index.ts --format esm,iife --sourcemap --dts --treeshake --clean --global-name {globalName}"
1111
},

0 commit comments

Comments
 (0)