Skip to content

Commit

Permalink
feat: export version
Browse files Browse the repository at this point in the history
  • Loading branch information
revelt committed Apr 10, 2022
1 parent 6a0c87c commit bac85cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/bitbucket-slug/README.md
Expand Up @@ -26,12 +26,14 @@

## Install

The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `2.1.0`.
This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required:

```bash
npm i bitbucket-slug
```

If you need a legacy version which works with `require`, use version 2.1.0

## Quick Take

```js
Expand Down
5 changes: 4 additions & 1 deletion packages/bitbucket-slug/src/main.ts
@@ -1,4 +1,7 @@
import deburr from "lodash.deburr";
import { version as v } from "../package.json";

const version: string = v;

/**
* Generate BitBucket readme header anchor slug URLs
Expand All @@ -19,4 +22,4 @@ function bSlug(str: string): string {
.replace(/ /g, "-")}`; // replace spaces with dashes
}

export { bSlug };
export { bSlug, version };
3 changes: 2 additions & 1 deletion packages/bitbucket-slug/types/index.d.ts
@@ -1,6 +1,7 @@
declare const version: string;
/**
* Generate BitBucket readme header anchor slug URLs
*/
declare function bSlug(str: string): string;

export { bSlug };
export { bSlug, version };

0 comments on commit bac85cf

Please sign in to comment.