Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ffflorian/pkgsource

Find the source of an npm package in an instant.
https://github.com/ffflorian/pkgsource

express github npm package server typescript

Last synced: 16 days ago
JSON representation

Find the source of an npm package in an instant.

Awesome Lists containing this project

README

        

# pkgsource [![Build Status](https://github.com/ffflorian/pkgsource/workflows/Build/badge.svg)](https://github.com/ffflorian/pkgsource/actions/)

Find (almost) every npm package's repository in an instant.

## Usage

Visit `pkgsource.xyz/{packageName}` in your web browser, e.g. [`pkgsource.xyz/nock`](https://pkgsource.xyz/nock).

### Get the repository for a specific version

Visit `pkgsource.xyz/{packageName}@{version}` in your web browser, e.g. [`pkgsource.xyz/[email protected]`](https://pkgsource.xyz/[email protected]). This also works with npm tags, e.g. [`pkgsource.xyz/typescript@beta`](https://pkgsource.xyz/typescript@beta)

If no version is specified, the latest version is assumed.

### Get the raw data

Visit `pkgsource.xyz/{packageName}?raw` in your web browser, e.g. [`pkgsource.xyz/commander?raw`](https://pkgsource.xyz/commander?raw).

### Get source code for a specific version

Visit `pkgsource.xyz/{packageName}?unpkg` in your web browser, e.g. [`pkgsource.xyz/[email protected]?unpkg`](https://pkgsource.xyz/[email protected]?unpkg). You can use the same features (`raw`, version, tags) as mentioned above.

## Server usage

### Docker

```
docker run -p 4000:4000 ffflorian/pkgsource
```

### Local

Prerequisites:

- [Node.js](https://nodejs.org) >= 10.9
- [yarn](https://classic.yarnpkg.com) < 2

### Start the server in development mode

```
yarn
yarn start:dev
```

### Start the server in production mode

```
yarn
yarn dist
yarn start
```

### Swagger UI

Open [`/_swagger-ui`](https://pkgsource.xyz/_swagger-ui) in the browser to try it out.