# nucleo-quasar

> Base configurations for Quasar projects

Latest version **2.6.3** (published 2025-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install nucleo-quasar
pnpm add nucleo-quasar
yarn add nucleo-quasar
bun add nucleo-quasar
```

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.6.3 |
| Published | 2025-03-14 |
| First published | 2020-03-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 65.2 KB |
| Known vulnerabilities | 0 (+27 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | João Cruz Araujo Neto |
| Maintainers | joaocruz |

## Links

- npm: https://www.npmjs.com/package/nucleo-quasar
- Repository: https://github.com/joaocruz-dev/nucleo-quasar
- Homepage: https://github.com/joaocruz-dev/nucleo-quasar#readme
- Issues: https://github.com/joaocruz-dev/nucleo-quasar/issues
- npm.io page: https://npm.io/package/nucleo-quasar

## Dependencies (3)

- [axios](https://npm.io/package/axios.md) ^0.21.1
- [quasar](https://npm.io/package/quasar.md) ^1.15.2
- [vuelidate](https://npm.io/package/vuelidate.md) ^0.7.6

## Recent versions

- 2.6.3 (latest) — 2025-03-14
- 2.6.2 — 2023-09-29
- 2.6.1 — 2023-09-29
- 2.5.99 — 2023-09-29
- 2.5.98 — 2023-07-25
- 2.5.97 — 2023-06-10
- 2.5.96 — 2023-06-05
- 2.5.95 — 2023-03-16
- 2.5.94 — 2023-03-15
- 2.5.93 — 2023-03-15
- 2.5.92 — 2023-03-14
- 2.5.91 — 2023-02-24
- 2.5.8 — 2023-02-19
- 2.5.7 — 2023-02-19
- 2.5.6 — 2023-02-19
- … 52 more at https://npm.io/package/nucleo-quasar/versions

## README

# nucleo-quasar

> Base configurations for Quasar projects

## Installation

```bash
npm install nucleo-quasar --save
```

```bash
yarn add nucleo-quasar
```

You can import the library and use as a Vue plugin to enable the functionality globally on all components.

```javascript
import Vue from 'vue'
import { NucleoQuasar, Msg } from 'nucleo-quasar'

Vue.use(NucleoQuasar, options)
```

## Configuration Options

These are the configuration options for everything to work.

```javascript
{
  api: {
    // `hostDev` is the URL of the server that will be used for requests in development mode
    hostDev: 'http://localhost:3000/api',
    // `hostProd` is the URL of the server that will be used for requests in production mode
    hostProd: 'https://api.maisdiarias.com/api',
    // `path` is a complementary path for requests
    path: {
      // site
      site: '/site',
      status: '/status'
    },
    // Function to be called when a request responds with 404 status
    // this is optional
    notFoundFn () {
      Msg('Rota indisponível', false)
    },
    // Function to be called when a request responds with 401 status
    // this is optional
    unauthorizedFn () {
      Msg('Acesso expirado', false)
    },
    // Function to be called by LoginToken
    // this is optional
    loginFn (resolve, reject, token) {
      console.log('loginFn', token)
    }
  },
  // Options of the Quasar Dialog used in Alert
  alert: {
    position: 'left',
    style: { backgroundColor: '#F0f0f0', color: '#404040' },
    ok: { textColor: 'white', color: 'accent' },
    cancel: { textColor: 'white', color: 'negative' }
  },
  // Options of the Quasar Dialog used in Delete
  // what not to change will be used as an `alert`
  delete: {}
}
```

## nucleo-quasar API

Request methods allowed.

##### api.get(path, options)
##### api.post(path, data, options)
##### api.put(path, data, options)
##### api.delete(path, data, options)

### Methods Options

```javascript
{
  // Set to 'true', the Authorization header will be inserted
  token: true,
  // Set to 'null' a 'response.data.message' message will be displayed using Msg
  // Set to 'true' will be returned reject on Promise
  // Set to 'false' console.error will be returned
  error: null,
  // Set to 'true', Quasar Loading will be used
  loading: true
}
```

## nucleo-quasar Msg

Vue prototype $Msg.

```javascript
import { Msg } from 'nucleo-quasar'

Msg(message, type, options)
```

## nucleo-quasar Alert

Vue prototype $Alert.

```javascript
import { alert } from 'nucleo-quasar'

alert(title, message, options)
```

## nucleo-quasar Delete

Vue prototype $Delete.

```javascript
import { delet } from 'nucleo-quasar'

delet(name, controller, data)
  .then(data => ...)
```

## Credits

- [Quasar](https://quasar.dev)
- [Axios](https://github.com/axios/axios)
- [Vuelidate](https://vuelidate.js.org)

## License

MIT

---
_Source: https://npm.io/package/nucleo-quasar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
