open-index/open-npm huggingface dataset:
npm package: @mechurao/logger
Description: Lightweight structured logger with colorized output
Author: Ondřej Mechura
Latest version: 1.4.1

# @mechurao/logger

[![npm version](https://img.shields.io/npm/v/@mechurao/logger)](https://www.npmjs.com/package/@mechurao/logger)
[![License](https://img.shields.io/npm/l/@mechurao/logger)](https://opensource.org/licenses/MIT)

A lightweight, structured, and color-coded logger for Node.js and TypeScript projects.  
Designed for both **ESM** and **CommonJS** environments, it provides consistent logging with module and component context, along with optional attributes.

---

## Features

- Color-coded output for `log`, `info`, `warn`, and `error`.
- Structured log format including module, component, and optional attributes.
- Full TypeScript support with `.d.ts` typings.
- Works seamlessly with both Node.js ESM and CommonJS.
- Simple to integrate into any Node.js project.

---

## Installation

```bash
npm install @mechurao/logger
```

---

## Usage

### Basic Example

```ts
import Logger from '@mechurao/logger';

Logger.log('App', 'Startup', 'Application has started');
Logger.info('Server', 'HTTP', 'Listening on port 3000');
Logger.warn('Cache', 'Redis', 'Response time is slow');
Logger.error('DB', 'MongoDB', 'Connection failed', { retry: true });
```

### With Attributes

Attributes allow you to attach structured data to your logs.

```ts
Logger.log('Auth', 'Login', 'User logged in', {
    userId: '123',
    ip: '127.0.0.1'
});
```

### Example Output

```
[Log]   2025-11-23 14:33:04  App             Startup         Application has started
[Info]  2025-11-23 14:33:04  Server          HTTP            Listening on port 3000
[Warn]  2025-11-23 14:33:04  Cache           Redis           Response time is slow
[Error] 2025-11-23 14:33:04  DB              MongoDB         Connection failed [ retry = true ]
```

### Using in CommonJS

```js
const Logger = require('@mechurao/logger').default;

Logger.log('App', 'Init', 'Running in CommonJS environment');
```

### Recommended Usage Pattern

You can create a wrapper per module for cleaner logs:

```ts
// logger.ts
import Logger from '@mechurao/logger';

export const AppLog = {
    startup: (msg, attr) => Logger.log('App', 'Startup', msg, attr),
    error: (msg, attr) => Logger.error('App', 'Error', msg, attr),
};
```

And use it anywhere:

```ts
import { AppLog } from './logger';

AppLog.startup('Application boot complete');
```
npm package: @meck/tinyapp-redux
Description: Tinyapp bindings for Redux
Author: starandtina
Latest version: 1.2.4

Tiny App Redux
=========================

Tiny App bindings for [Redux](https://github.com/reduxjs/redux).

## Installation

```
npm install --save tinyapp-redux
```

## How Does It Work?

### 1、`injectStore`

```JavaScript
import { createStore, applyMiddleware } from 'redux'
import { injectStore } from 'tinyapp-redux'
import logger from 'redux-logger'

import rootReducer from './reducers'

const initState = {
  todos: [
    { id: 1, text: 'Learning Javascript', completed: false },
    { id: 2, text: 'Learning ES2019', completed: true },
    { id: 3, text: 'Learning 支付宝小程序', completed: true },
  ],
}

App({
  onLaunch() {
    this.store = createStore(rootReducer, initState, applyMiddleware(logger))

    injectStore(this.store) // inject the store into the tiny app
  },
})
```

或者通过默认提供的 `Provider` 函数来注入当前 `store`

```JavaScript
import { Provider } from 'tinyapp-redux'
import store from './createStore'

App(
  Provider(store)({
    onLaunch(options) {
      // 小程序初始化
    },
    ...
  }),
)
```

### 2、Connect the state with your Page or Component

```JavaScript
import { connect } from 'tinyapp-redux'

import {
  toggleTodo,
  setVisibilityFilter,
  VisibilityFilters,
} from '../../actions'
import { getVisibleTodos } from '../../reducers'

const mapStateToProps = state => ({
  todos: getVisibleTodos(state, state.visibilityFilter),
})

Page(
  connect(
    mapStateToProps,
    { toggleTodo },
    {
      data: { VisibilityFilters },
      onTodoChanged(e) {
        this.data.toggleTodo(e.target.dataset.id)
      },
      addTodo() {
        my.navigateTo({ url: '../add-todo/add-todo' })
      },
    },
  ),
)

```

## Demos

- [x] Todo
- [ ] Counter
- [ ] Async

## License

MIT
npm package: @meclouds/admin-ui
Description: <p align="center">   <a href="https://www.medusajs.com">     <img alt="Medusa" src="https://user-images.githubusercontent.com/7554214/153162406-bf8fd16f-aa98-4604-b87b-e13ab4baf604.png" width="100" />   </a> </p> <h1 align="center">   @medusajs/admin-ui <
Author: Kasper Kristensen
Latest version: 2.1.16

<p align="center">
  <a href="https://www.medusajs.com">
    <img alt="Medusa" src="https://user-images.githubusercontent.com/7554214/153162406-bf8fd16f-aa98-4604-b87b-e13ab4baf604.png" width="100" />
  </a>
</p>
<h1 align="center">
  @medusajs/admin-ui
</h1>

<h4 align="center">
  <a href="https://docs.medusajs.com">Documentation</a> |
  <a href="https://demo.medusajs.com/">Medusa Admin Demo</a> |
  <a href="https://www.medusajs.com">Website</a>
</h4>

<p align="center">
An open source composable commerce engine built for developers.
</p>
<p align="center">
  <a href="https://github.com/medusajs/medusa/blob/master/LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Medusa is released under the MIT license." />
  </a>
  <a href="https://circleci.com/gh/medusajs/medusa">
    <img src="https://circleci.com/gh/medusajs/medusa.svg?style=shield" alt="Current CircleCI build status." />
  </a>
  <a href="https://github.com/medusajs/medusa/blob/master/CONTRIBUTING.md">
    <img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat" alt="PRs welcome!" />
  </a>
    <a href="https://www.producthunt.com/posts/medusa"><img src="https://img.shields.io/badge/Product%20Hunt-%231%20Product%20of%20the%20Day-%23DA552E" alt="Product Hunt"></a>
  <a href="https://discord.gg/xpCwq3Kfn8">
    <img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg" alt="Discord Chat" />
  </a>
  <a href="https://twitter.com/intent/follow?screen_name=medusajs">
    <img src="https://img.shields.io/twitter/follow/medusajs.svg?label=Follow%20@medusajs" alt="Follow @medusajs" />
  </a>
</p>

## The Medusa Admin App. Included with the [`@medusajs/admin`](https://www.npmjs.com/package/@medusajs/admin) plugin. You shouldn't install this package separately.
npm package: @mecode-asia/do-module
Description: A module used for interact with Digital Ocean services
Author: Phornphatch
Latest version: 0.1.0

# DO Module

A module used for interact with Digital Ocean services

- DO Spaces

## DO Spaces

This module allow user to:

- Generate pre-signed url to upload file to Digital Ocean spaces (or any S3 compatible storage)
- Generate view link for privately uploaded files
- Generate public view link for publicly uploaded files
- Delete a file from the storage

### Usage

- Install this library by running

```
yarn add @mecode-asia/do-module
```

Your NestJS application requires:

- `ConfigModule` - For reading ENVs as config service. [Installation guide](https://docs.nestjs.com/techniques/configuration#installation)

- These ENVs (either in `.env` file or exported as ENV variable)

```
SPACES_ENDPOINT=https://sgp1.digitaloceanspaces.com/ # endpoint of your space
SPACES_REGION=sgp1 # region of your space
SPACES_NAME=<name of your space>
SPACES_KEY=<your space access key>
SPACES_SECRET=<your space secret key>
```

- Import `DoModule` into your `AppModule`

```typescript
import { DoModule } from '@mecode-asia/do-module';

@Module({
  imports: [ConfigModule.forRoot(), DoModule],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
```

- Inject `SpacesService` into your controller and use it.

```typescript
@Controller()
export class AppController {
  constructor(private readonly spacesService: SpacesService) {}

  @Get()
  async genUploadLink(): Promise<string> {
    const { url } = await this.spacesService.generateUploadLink(
      'test.jpeg',
      'image/jpeg',
    );
    return url;
  }
}
```

The pre-signed url is creating a private file by default. To upload as public file, add this header when uploading the file with the pre-signed url

```
x-amz-acl: 'public-read'
```

For example with Axios:

```typescript
const { status } = await axios.put(presignedUrl, file, {
  'x-amz-acl': 'public-read',
});
```

#### API reference

**SpacesService**

`generateUploadLink` takes file name and file content type and generate a presigned url for file upload. To ensure uniqueness of the file, the name is suffixed with unix timestamp.

It returns presigned url with suffixed filename.

`generateViewLink` takes suffixed name, content type and isDownload and generate link to access the private file which expired in 5 hours

If `isDownload` is true, the file will be downloaded automatically when accessing the link on a browser. If not, the link view preview the on the browser directly.

`deleteFile` takes suffixed name, content type. It deletes the file from the storage.

`getPublicUrl` takes the suffixed file name and returns a publicly accessible link.
npm package: @mecode-asia/google-analytics-pageviews-api
Description: Can fetch view count for any path name on your GA property
Author: SPK137
Latest version: 0.0.5

## Google Analytics API
An API for running core Google Analytics Report from Google Analytics Data API for GA4

## Purpose
This project is created to remove needs of creating Google Analytics API for each individual project.

## Prerequisites
- Node.js

## Features
- Connect to Google Analytics Data API using Property ID and Service Account file path provided upon the instantiation of GoogleAnalyticsClient class

## Installation
- Run the following commands according to your project's npm manager
```
// npm
npm add google-analytics-pageviews-api
// yarn
yarn add google-analytics-pageviews-api
// pnpm
pnpm add google-analytics-pageviews-api
```

## How to use
- Input GA Property ID and Google Service Account File Path as params when instantiating the GoogleAnalyticsClient. (It is advised to set both parameters as ENV variables)
- Access the class method to use the client
```
import { GoogleAnalyticsClient, PageviewsDto } from 'google-analytics-pageviews-api'

const gaPropertyID = '123456789'
const gaCredentialsPath = '/path/to/file'

const gaClient = new GoogleAnalyticsClient(gaPropertyID, gaCredentialsPath)

export async function getPageViews(articleSlug) {
  const pageViewsCount: PageviewsDto = await gaClient.getPageviews(`/articles/${articleSlug}`)
  return pageViewsCount?.viewCount || 0
}
// returned value: {pagePath: provided page path, viewCount: number of page views}
```

## License
Copyright (c) 2023 MeCode