@culur/utils-packages
v1.2.8
Published
Culur's packages exist
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({
// vue: true,
sass: true,
tailwind: 3, // false or 3 or 4
});
hasVue(); // true or false (detect automatically)
hasSass(); // true (from override)
hasTailwind(); // true (from override)
tailwindVersion(); // 3 (from override)import { defineHasPackages } from '@culur/utils-packages';
// initialize a new instance
const {
updateDefaultPackages, //
hasVue,
hasSass,
hasTailwind,
tailwindVersion,
} = defineHasPackages({
sass: false, // (override)
});🗃️ Changelog
See CHANGELOG for more information on what has changed recently.
🔒 License
See LICENSE for license rights and limitations (MIT).
