Coder Social home page Coder Social logo

unjs / lmify Goto Github PK

View Code? Open in Web Editor NEW
201.0 3.0 12.0 354 KB

๐Ÿค™ Install NPM dependencies programmatically (please switch to unjs/nypm)

Home Page: https://github.com/unjs/nypm

License: MIT License

JavaScript 100.00%
node npm yarn automation install

lmify's Introduction

lmify

Let Me Install It For You! Install NPM dependencies programmatically ๐Ÿค™

This package is discontinued. Checkout unjs/nypm for a much better alternative!

Features

  • Support Yarn and NPM
  • Auto package manager detection
    • Using Yarn if yarn.lock
    • Using NPM if package-lock.json or package.json
  • Singleton or Class API
  • Optional granters

Install

Using yarn:

yarn add lmify

Using npm:

npm install lmify

Usage

install(package|packages)

Install one or more packages in rootDir using the preferred package manager.

const { install } = require('lmify')

await install('package-name')

setPackageManager(name)

Set preferred package manager to use. By default, it will be guessed.

const { setPackageManager } = require('lmify')

setPackageManager('yarn')

setRootDir(rootDir)

Set project root dir. This causes package manager detection to happen on the next install.

const { setRootDir } = require('lmify')

setRootDir(proccess.cwd())

addGranter(fn)

Add a granter function to ask the user before installing packages.

This function accepts an array of packages to be added and should return Promise<Boolean>.

Without a granter, install immediately adds package.

If multiple granters added, the first response will be used (either deny or allow).

const { addGranter } = require('lmify')

addGranter(async packages => {
  console.log('Installing packages:', packages)
  return true // Allow
})

Class: LMIFY

You can choose between using singleton instance or creating a new instance of LMIFY:

const LMIFY = require('lmify')

const constumInstance = new LMIFY(options)

options

  • stdout: Defaults to process.stdout
  • stderr: Defaults to process.stderr
  • rootDir: Defaults to process.cwd()
  • packageManager: Better if specified or install will throw a warning if no package manager is detected

License

MIT - Made with ๐Ÿ’– by Nuxt.js team!

lmify's People

Contributors

atinux avatar nozomuikuta avatar pi0 avatar potato4d avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lmify's Issues

Wrong Typescript Definition

The typescript definition does not match the actual JS implementation.

Expect:

let dir = ''
// expect no type error
setRootDir(dir)

Result:

file.ts:97:16 - error TS2554: Expected 0 arguments, but got 1.

97     setRootDir(dir);
                  ~~~

Compile error (execa.ExecaReturns)

Hi, so i get this build-error in my application using lmify:

node_modules/lmify/types/lmify.d.ts:18:54 - error TS2694: Namespace 'execa' has no exported member 'ExecaReturns'.

Inspecting the execa-library it does indeed not export "ExecaReturns". Changing types/lmify.d.ts to "execa.ReturnValue" resolves the issue, however I do not have the insights in this library or execa to know wheter that is the correct fix for the issue.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update all non-major dependencies (@babel/preset-env, eslint-plugin-import, npm, yarn)

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update devdependency npm to v9
  • chore(deps): update devdependency rimraf to v4
  • chore(deps): update devdependency standard-version to v9
  • chore(deps): update jest monorepo to v29 (major) (babel-jest, jest)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/setup-node v3
  • actions/cache v1
  • codecov/codecov-action v1
npm
package.json
  • execa ^4.1.0
  • fs-extra ^9.1.0
  • std-env ^2.3.1
  • @babel/preset-env ^7.16.11
  • @nuxtjs/eslint-config ^2.0.2
  • @types/execa ^2.0.0
  • babel-jest ^25.5.1
  • bili ^4.10.1
  • codecov ^3.8.2
  • eslint ^7.32.0
  • eslint-config-standard ^14.1.1
  • eslint-plugin-import ^2.26.0
  • eslint-plugin-jest ^23.20.0
  • eslint-plugin-node ^11.1.0
  • eslint-plugin-promise ^4.3.1
  • eslint-plugin-standard ^4.1.0
  • eslint-plugin-vue ^6.2.2
  • esm ^3.2.25
  • jest ^25.5.4
  • npm ^6.14.16
  • rimraf ^3.0.2
  • standard-version ^7.1.0
  • yarn ^1.22.18

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

File: renovate.json
Error type: The renovate configuration file contains some invalid settings
Message: One or more configured baseBranches are missing from this repo: dev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.