You've already forked npm-module-template
mirror of
https://github.com/jakejarvis/npm-module-template.git
synced 2025-09-18 15:25:31 -04:00
add README badges and usage section
This commit is contained in:
20
README.md
20
README.md
@@ -1,13 +1,33 @@
|
|||||||
# Universal JS Boilerplate
|
# Universal JS Boilerplate
|
||||||
|
|
||||||
|
[](https://github.com/jakejarvis/npm-module-template/actions/workflows/ci.yml)
|
||||||
|
[](https://www.npmjs.com/package/@jakejarvis/my-module)
|
||||||
|
[](LICENSE)
|
||||||
|
|
||||||
Just a personal boilerplate to my liking for an Node and/or browser module w/ ESM, CommonJS, and UMD outputs via Babel & Rollup. Ready to publish on NPM and/or GitHub Packages and distibute via unpkg, skypack.dev, etc.
|
Just a personal boilerplate to my liking for an Node and/or browser module w/ ESM, CommonJS, and UMD outputs via Babel & Rollup. Ready to publish on NPM and/or GitHub Packages and distibute via unpkg, skypack.dev, etc.
|
||||||
|
|
||||||
Probably not very useful to anybody else. 😊
|
Probably not very useful to anybody else. 😊
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
### something(options?)
|
||||||
|
|
||||||
|
#### options
|
||||||
|
|
||||||
|
Type: `object`
|
||||||
|
|
||||||
|
##### doSomething
|
||||||
|
|
||||||
|
Type: `boolean`\
|
||||||
|
Default: `false`
|
||||||
|
|
||||||
|
Makes it do something.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
- [dark-mode-switcheroo](https://github.com/jakejarvis/dark-mode)
|
- [dark-mode-switcheroo](https://github.com/jakejarvis/dark-mode)
|
||||||
- [simple-anchor](https://github.com/jakejarvis/simple-anchor)
|
- [simple-anchor](https://github.com/jakejarvis/simple-anchor)
|
||||||
|
- [get-canonical-url](https://github.com/jakejarvis/get-canonical-url)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
11
src/index.d.ts
vendored
11
src/index.d.ts
vendored
@@ -1,4 +1,13 @@
|
|||||||
|
export interface Options {
|
||||||
|
/**
|
||||||
|
* Make it do something.
|
||||||
|
*
|
||||||
|
* @default false
|
||||||
|
*/
|
||||||
|
readonly doSomething?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does pretty much nothing, contrary to its name.
|
* Does pretty much nothing, contrary to its name.
|
||||||
*/
|
*/
|
||||||
export function something(): void;
|
export function something(options?: Options): void;
|
||||||
|
@@ -1,5 +1,8 @@
|
|||||||
const something = function () {
|
const something = function (options) {
|
||||||
console.info("well hello there");
|
options = options || {};
|
||||||
|
if (options.doSomething) {
|
||||||
|
console.info("well hello there");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export { something };
|
export { something };
|
||||||
|
Reference in New Issue
Block a user