open-index/open-npm huggingface dataset:
npm package: @moevis/dsn-parser
Description: fork from https://github.com/fonini/dsn-parser
Author: moevis.zjj
Latest version: 1.0.1

# parser for dsn

fork from https://github.com/fonini/dsn-parser

```typescript
const DSNParser = require('dsn-parser');

const dsn = new DSNParser('pgsql://user:pass@127.0.0.1:5432/my_db?sslmode=verify-full&application_name=myapp');
dsn.getParts();

/*
{ 
  driver: 'pgsql',
  user: 'user',
  password: 'pass',
  host: '127.0.0.1',
  port: 5432,
  database: 'my_db',
  params: { sslmode: 'verify-full', application_name: 'myapp' } 
} */
```
npm package: @moevis/restpower
Description: ```typescript import "reflect-metadata"; import { API, RestPower, Get, Header, Path, Post, Query, R } from "restpower";
Author: moevery@gmail.com
Latest version: 0.0.3

# RestPower: a new way to write a http client

```typescript
import "reflect-metadata";
import { API, RestPower, Get, Header, Path, Post, Query, R } from "restpower";

@API({ prefix: "/api/user" })
class UserService extends RestPower {
  @Get("/profile")
  profile() {
    return R<{ name: string }>();
  }

  @Get("/{id}/profile")
  userProfile(@Path("id") _user_id: string) {
    return Promise.resolve({} as IResp);
  }

  @Get("/{0}/profile")
  userProfile2(_user_id: string) {
    return R<{ data: string }>();
  }

  @Get("/posts")
  posts(
    @Query("key") _key: string,
    @Query() _paginator: { pageSize: number; page: number }
  ) {
    return R<{}>();
  }

  @Post("/login")
  login(@Body() _user: IUser) {
    return R<{}>();
  }

  @Post("/any")
  anyRoute(
    @Body() _body: { name: string },
    @Query() _q: { age: number },
    @Header("tttt") _h: string
  ) {
    return R<{}>();
  }
}

interface IUser {
  user: string;
  password: string;
}

const service = new UserService();

service.userProfile("uid");
```