@culur/utils-packages
v1.1.0
Published
Culur's packages exist
Downloads
24
Readme
@culur/utils-packages
Check if environments are installed or not.
✨ Features
This library use local-pkg
to check if the following environments are installed.
| Function | Packages |
| ------------- | ----------------------------------------------- |
| hasTailwind
| tailwindcss
|
| hasSass
| sass
or dart-sass
or node-sass
|
| hasVue
| vue
or nuxt
or vitepress
or @slidev/cli
|
💿 Installation
Add @culur/utils-packages
dependency to your project.
# Using npm
npm install @culur/utils-packages --save-dev
# Using pnpm
pnpm install @culur/utils-packages --dev
# Using yarn
yarn add @culur/utils-packages --dev
📖 Usage
import {
hasSass,
hasTailwind,
hasVue,
updateDefaultPackages,
} from '@culur/utils-packages';
// detect automatically or override
updateDefaultPackages({
sass: false,
tailwind: true,
// vue: true,
});
hasSass(); // false (from override)
hasTailwind(); // true (from override)
hasVue(); // true or false (detect automatically)
import { defineHasPackages } from '@culur/utils-packages';
// initialize a new instance
const {
updateDefaultPackages, //
hasSass,
hasTailwind,
hasVue,
} = defineHasPackages({
sass: false, // (override)
});
🗃️ Changelog
See CHANGELOG for more information on what has changed recently.
🔒 License
See LICENSE for license rights and limitations (MIT).