Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yyz945947732/open-npm-link
Open the npm link for the package
https://github.com/yyz945947732/open-npm-link
browser launch npm npmlink open opener opens package website
Last synced: 28 days ago
JSON representation
Open the npm link for the package
- Host: GitHub
- URL: https://github.com/yyz945947732/open-npm-link
- Owner: yyz945947732
- License: mit
- Created: 2023-10-03T08:55:08.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-03T11:15:21.000Z (about 1 year ago)
- Last Synced: 2024-11-16T19:21:05.856Z (about 1 month ago)
- Topics: browser, launch, npm, npmlink, open, opener, opens, package, website
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/open-npm-link
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# open-npm-link
> Open the npm link for the package
This is meant to be used in command-line tools and scripts, not in the browser.
## Install
```bash
npm install --save open-npm-link
```**Warning:** This package is native [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) and no longer provides a CommonJS export. If your project uses CommonJS, you will have to [convert to ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) or use the [dynamic `import()`](https://v8.dev/features/dynamic-import) function. Please don't open issues for questions regarding CommonJS / ESM.
## Usage
```js
import open from 'open-npm-link';// Opens the react npm link in the default browser.
await open('lodash');// Opens the react npm link in the specified browser.
await open('lodash', 'chrome');
```### API
```js
function(packageName?: string, browser?: string): string;
```## Supported browser
- [`chrome`](https://www.google.com/chrome) - Web browser
- [`firefox`](https://www.mozilla.org/firefox) - Web browser
- [`edge`](https://www.microsoft.com/edge) - Web browser
- `browser` - Default web browser
- `browserPrivate` - Default web browser in incognito mode`browser` and `browserPrivate` only supports `chrome`, `firefox`, and `edge`.
## Related
- [open-npm-link-cli](https://github.com/yyz945947732/open-npm-link-cli) - CLI for this module
## LICENSE
[MIT](https://github.com/yyz945947732/open-npm-link/blob/master/LICENSE)
---
This project is created using [generator-stupid](https://github.com/yyz945947732/generator-stupid).