mirror of
https://github.com/jakejarvis/npm-module-template.git
synced 2025-04-26 06:25:23 -04:00
add README badges and usage section
This commit is contained in:
parent
8d3f097e9c
commit
c386d3b80f
20
README.md
20
README.md
@ -1,13 +1,33 @@
|
||||
# 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.
|
||||
|
||||
Probably not very useful to anybody else. 😊
|
||||
|
||||
## Usage
|
||||
|
||||
### something(options?)
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### doSomething
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
Makes it do something.
|
||||
|
||||
## Examples
|
||||
|
||||
- [dark-mode-switcheroo](https://github.com/jakejarvis/dark-mode)
|
||||
- [simple-anchor](https://github.com/jakejarvis/simple-anchor)
|
||||
- [get-canonical-url](https://github.com/jakejarvis/get-canonical-url)
|
||||
|
||||
## 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.
|
||||
*/
|
||||
export function something(): void;
|
||||
export function something(options?: Options): void;
|
||||
|
@ -1,5 +1,8 @@
|
||||
const something = function () {
|
||||
console.info("well hello there");
|
||||
const something = function (options) {
|
||||
options = options || {};
|
||||
if (options.doSomething) {
|
||||
console.info("well hello there");
|
||||
}
|
||||
};
|
||||
|
||||
export { something };
|
||||
|
Loading…
x
Reference in New Issue
Block a user