Skip to content

Commit 1752633

Browse files
authored
Merge pull request #32 from johnie/feature/readme
fix: update README for clarity and consistency in code examples
2 parents 0388a80 + 871a397 commit 1752633

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

README.md

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
$ npm install --save-dev esbuild-coffeescript
1111
```
1212

13+
## Compatibility
14+
15+
This plugin is tested against Node.js versions 20.x, 22.x, and 24.x.
16+
1317
## Getting Started
1418

1519
`main.coffee`
@@ -22,19 +26,20 @@ console.log("the answer is #{answer}")
2226
`build.js`
2327

2428
```js
25-
const coffeeScriptPlugin = require('esbuild-coffeescript');
29+
import coffeeScriptPlugin from 'esbuild-coffeescript';
30+
import esbuild from 'esbuild';
2631

27-
require('esbuild').build({
32+
esbuild.build({
2833
entryPoints: ['main.coffee'],
2934
bundle: true,
3035
outfile: 'out.js',
3136
plugins: [coffeeScriptPlugin()],
32-
});
37+
}).catch(() => process.exit(1));
3338
```
3439

3540
## Configuration
3641

37-
An object containing configuration options may be passed into the plugin constructor `coffeeScriptPlugin`
42+
An object containing configuration options may be passed into the plugin constructor `coffeeScriptPlugin`.
3843

3944
```js
4045
coffeeScriptPlugin({
@@ -44,12 +49,13 @@ coffeeScriptPlugin({
4449

4550
The following options are available:
4651

47-
- `options.inlineMap`, `boolean`: if true, output the source map as a base64-encoded string in a comment at the bottom.
48-
- `options.filename`, `string`: the filename to use for the source map. It can include a path (relative or absolute).
49-
- `options.bare`, `boolean`: if true, output without the top-level function safety wrapper.
50-
- `options.header`, `boolean`: if true, output the Generated by CoffeeScript header.
51-
- `options.transpile`, `object`: if set, this must be an object with the options to pass to Babel. See [Transpilation](https://coffeescript.org/#transpilation).
52-
- `options.ast`, `boolean`: if true, return an abstract syntax tree of the input CoffeeScript source code.
52+
* `options.inlineMap`, `boolean`: if true, output the source map as a base64-encoded string in a comment at the bottom.
53+
* `options.filename`, `string`: the filename to use for the source map. It can include a path (relative or absolute).
54+
* `options.bare`, `boolean`: if true, output without the top-level function safety wrapper.
55+
* `options.header`, `boolean`: if true, output the Generated by CoffeeScript header.
56+
* `options.transpile`, `object`: if set, this must be an object with the options to pass to Babel. See [Transpilation](https://coffeescript.org/#transpilation).
57+
* `options.ast`, `boolean`: if true, return an abstract syntax tree of the input CoffeeScript source code.
58+
* `options.literate`, `boolean`: if true, parses the code as Literate CoffeeScript. This allows you to write CoffeeScript embedded in Markdown, where indented blocks are treated as executable code.
5359

5460
### But CoffeeScript is dead?
5561

0 commit comments

Comments
 (0)