Coder Social home page Coder Social logo

boot-yarn's Introduction

boot-npm

Clojars Project Dependencies Status Downloads

Yarn (npm package manager) wrapper for boot-clj. this lib is based on work done in https://github.com/degree9/boot-npm

  • Provides yarn task for installing node modules.
  • Provides exec task for executing node modules. (auto-installs local module)

The following outlines basic usage of the task, extensive testing has not been done. Please submit issues and pull requests!

Usage

Add boot-yarn to your build.boot dependencies and require the namespace:

(set-env! :dependencies '[[ag/boot-yarn "X.Y.Z" :scope "test"]])
(require '[ag.boot-yarn :refer [yarn]])

Install a Node Module:

(boot/deftask bower
  "Install bower to node_modules."
  []
  (yarn :add {:bower "latest"})))

##Task Options

The yarn task exposes a few options when using npm as part of a build process.

[p package     VAL     str      "An edn file containing a package.json map."
 a add         FOO=BAR {kw str} "Dependency map."
 d develop             bool     "Include development dependencies with packages."
 r dry-run             bool     "Report what changes npm would have made. (usefull with boot -vv)"
 g global              bool     "Opperates in global mode. Packages are installed to prefix."
 c cache-key   VAL     kw       "Optional cache key for when npm is used with multiple dependency sets."
 _ include             bool     "Include package.json in fileset output."
 _ pretty              bool     "Pretty print generated package.json file"]
 s silent              bool     "No output"

The :install option is provided for installing node modules, takes a map containing a dependency/version pair. This will install the module to a temporary node_modules folder and include this folder in the fileset output.

(boot/deftask bower
  "Install bower to node_modules."
  []
  (yarn :add {:bower "latest"}))

The :cache-key option is provided to avoid downloading node modules each time boot is restarted. This will cache the node_modules folder and include this folder in the fileset output.

(boot/deftask bower
  "Install bower to node_modules."
  []
  (yarn :add   {:bower "latest"}
        :cache-key ::cache))

boot-yarn's People

Contributors

agzam avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.