simple-scaffold 1.1.0-alpha.3 → 1.1.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -148,11 +148,11 @@ const scaffold = Scaffold(config)
|
|
|
148
148
|
In addition to all the options available in the command line, there are some Node/JS-specific
|
|
149
149
|
options available:
|
|
150
150
|
|
|
151
|
-
| Option | Type
|
|
152
|
-
| ------------- |
|
|
153
|
-
| `output` |
|
|
154
|
-
| `helpers` | `Record<string, (string) => string>`
|
|
155
|
-
| `beforeWrite` | `(content: Buffer, rawContent: Buffer, outputPath: string) => String \| Buffer \| undefined` | Supply this function to override the final output contents of each of your files. The return value of this function will replace the output content of the respective file, which you may discriminate (if needed) using the `outputPath` argument. |
|
|
151
|
+
| Option | Type | Description |
|
|
152
|
+
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
153
|
+
| `output` | | In addition to being passed the same as CLI, it may also be passed a function for each input file to output into a dynamic path: `{ output: (fullPath, baseDir, baseName) => path.resolve(baseDir, baseName) }` |
|
|
154
|
+
| `helpers` | `Record<string, (string) => string>` | Helpers are simple functions that transform your `data` variables into other values. See [Helpers](#helpers) for the list of default helpers, or add your own to be loaded into the template parser. |
|
|
155
|
+
| `beforeWrite` | `(content: Buffer, rawContent: Buffer, outputPath: string) => Promise<String \| Buffer \| undefined> \| String \| Buffer \| undefined` | Supply this function to override the final output contents of each of your files. The return value of this function will replace the output content of the respective file, which you may discriminate (if needed) using the `outputPath` argument. |
|
|
156
156
|
|
|
157
157
|
## Preparing files
|
|
158
158
|
|
package/package.json
CHANGED