All Projects → endenwer → Npm Rails

endenwer / Npm Rails

Licence: mit
NPM support for Rails with Bundler-like DSL

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Npm Rails

Npm Pipeline Rails
Use npm as part of your Rails asset pipeline
Stars: ✭ 93 (+14.81%)
Mutual labels:  browserify, rails, npm
Browserify Rails
Browserify + Rails = a great way to modularize your legacy JavaScript
Stars: ✭ 701 (+765.43%)
Mutual labels:  browserify, rails
Awesome Mad Science
Delightful npm packages that make you say "wow, didn't know that was possible!"
Stars: ✭ 909 (+1022.22%)
Mutual labels:  browserify, npm
Incompose
A inferno utility belt for function components and higher-order components
Stars: ✭ 76 (-6.17%)
Mutual labels:  npm
Template.js
A javascript template engine, simple, easy & extras, support webpack, rollup, parcel, browserify, fis and gulp
Stars: ✭ 1,201 (+1382.72%)
Mutual labels:  browserify
Vglist
A video game library tracking web app built in Rails and powered by Wikidata.
Stars: ✭ 78 (-3.7%)
Mutual labels:  rails
Rails Webpacker
Rails on webpack and yarn with new webpacker gem. Multiple examples using react, vue and angular
Stars: ✭ 80 (-1.23%)
Mutual labels:  rails
Bump
🌱 Sublime Text 3 Plugin to keep package.json dependencies fresh.
Stars: ✭ 76 (-6.17%)
Mutual labels:  npm
Rails Apz
The guide to build a Rails app from a to z.
Stars: ✭ 79 (-2.47%)
Mutual labels:  rails
Realtime Rails
Realtime rails support. See website for documentation:
Stars: ✭ 77 (-4.94%)
Mutual labels:  rails
React Image Timeline
📆 An image-centric timeline component for React.js
Stars: ✭ 77 (-4.94%)
Mutual labels:  npm
Acts as hashids
Use Youtube-Like ID in ActiveRecord seamlessly.
Stars: ✭ 76 (-6.17%)
Mutual labels:  rails
Xa
Beautiful & Customizable logger ❤️
Stars: ✭ 78 (-3.7%)
Mutual labels:  npm
Emma Cli
📦 Terminal assistant to find and install node packages.
Stars: ✭ 1,201 (+1382.72%)
Mutual labels:  npm
Karafka
Framework for Apache Kafka based Ruby and Rails applications development.
Stars: ✭ 1,223 (+1409.88%)
Mutual labels:  rails
Activeadmin quill editor
Quill Rich Text Editor for ActiveAdmin
Stars: ✭ 76 (-6.17%)
Mutual labels:  rails
Formadmin
Modern and responsive theme for Active Admin used by Formaweb.
Stars: ✭ 79 (-2.47%)
Mutual labels:  rails
Tabler Rubygem
Rubygem for https://tabler.github.io
Stars: ✭ 77 (-4.94%)
Mutual labels:  rails
Rails emoji
Emoji for Ruby on Rails
Stars: ✭ 76 (-6.17%)
Mutual labels:  rails
Minimal Feedback
🗳 minimal-feedback is a blazingly fast and highly customizable component to get user feedback.
Stars: ✭ 78 (-3.7%)
Mutual labels:  npm

npm-rails

Gem Version Code Climate Dependency Status Build Status Coverage Status

NPM support for Rails projects. It let you use Bundler-like DSL and rake tasks for including npm packages. This gem based on Browserify for bundling packages and resolve dependencies.

Installation

Add this line to your application's Gemfile:

gem 'npm-rails'

Then run:

rails g npm_rails:initialize

And require npm-dependencies.js:

//=require npm-dependencies

Usage

  1. Add a package to npm_packages file
  2. Run rake npm:install
  3. Use the package in your javascript code by calling the camelize name or build_name if you set it

Example npm_packages file

# call 'React' in your js code to use it
npm 'react'

# Set version
npm 'redux', '3.3.1'

# Set build_name to a package.
# Call '_' to get Underscore
npm 'underscore', build_name: '_'

# You can add a package for development
npm 'jasmine', development: true

# Or in block
development do
  npm 'jasmine'
end

# Install a package but do not require it
npm 'browserify', require: false

Configuration Options

The following options are available for configuration in your application or environment-level config files (config/application.rb, config/environments/development.rb, etc.):

Configuration Option Description
config.npm.package_file Specificies a package file. Default value: npm_packages
config.npm.output_file Specifies a file where to bundle npm packages. Default value for production: vendor/assets/javascripts/npm-rails/production/npm-dependencies.js. Default value for other environments: vendor/assets/javascripts/npm-rails/development/npm-dependencies.js
config.npm.browserify_options Sets options for browserify command. See all available options in Browserify documentation
config.npm.run_before_assets_precompile If set to true then run rake npm:install before assets precompilation. Default value: false

How it works

The generator creates npm_packages file. This file contains a list of packages. Rake uses NPM to install the packages and Browserify to bundle them. Browserify output the bundled results to output_file(see configuration options), which are then loaded by sprockets. All packages attached to window by build_name, which by default is the camelize package name.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].