Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
@vue/cli-shared-utils
Advanced tools
The @vue/cli-shared-utils package provides a set of utilities for Vue CLI and Vue projects. These utilities include functions for logging, validation, module loading, and other common tasks needed by Vue CLI plugins and other project tooling.
Logging
Provides functions to output log messages with different levels of importance.
const { log, warn, error } = require('@vue/cli-shared-utils');
log('This is a log message.');
warn('This is a warning message.');
error('This is an error message.');
Validation
Includes functions to validate strings such as project names.
const { validateProjectName } = require('@vue/cli-shared-utils');
const projectName = 'example';
if (validateProjectName(projectName)) {
log('Project name is valid.');
} else {
error('Project name is invalid.');
}
Module Loading
Provides a function to safely load modules that may or may not be present in the project.
const { loadModule } = require('@vue/cli-shared-utils');
const moduleName = 'vue';
const module = loadModule(moduleName, __dirname);
if (module) {
log(`Loaded ${moduleName} module.`);
} else {
error(`Failed to load ${moduleName} module.`);
}
Lodash is a utility library offering a wide range of methods for tasks like data manipulation, testing, and logic. It's more general-purpose compared to @vue/cli-shared-utils, which is tailored for Vue CLI.
Chalk is a library for styling terminal text. It offers functionality similar to the logging aspect of @vue/cli-shared-utils but is focused solely on text styling and does not provide logging levels.
Yargs is a library to help build command-line tools. It provides argument parsing which is a different scope compared to @vue/cli-shared-utils, but both are used in CLI environments.
shared-utils for vue-cli
4.0.0-rc.0 (2019-08-21)
@vue/cli-service
@vue/cli-plugin-eslint
, @vue/cli-ui
@vue/cli-service
@vue/cli-plugin-unit-jest
, @vue/cli-plugin-unit-mocha
@vue/cli-ui-addon-webpack
, @vue/cli-ui
@vue/cli-service
@vue/cli-plugin-babel
, @vue/cli-plugin-eslint
, @vue/cli-plugin-pwa
, @vue/cli-plugin-typescript
, @vue/cli-service
FAQs
shared utilities for vue-cli packages
The npm package @vue/cli-shared-utils receives a total of 740,070 weekly downloads. As such, @vue/cli-shared-utils popularity was classified as popular.
We found that @vue/cli-shared-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.