
Security News
Node.js Homepage Adds Paid Support Link, Prompting Contributor Pushback
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
jim is your friendly javascript library manager. He downloads, stores, bundles, vendors and compresses.
I'm frustrated with a lot of copy and pasting JS files from one directory to another and downloading new versions to who knows where and only really being able to use sprockets in Rails and lots of other small annoying things about the existing JS package/asset managers.
Jim uses a lot of stolen ideas from a lot of great projects. Namely:
The goals are simple:
So far I've accomplished the goals, but this is all very very very beta and
the API is sure to change and thing straight-up might not work.
jim is a rubygem:
$ gem install jim
You can also clone the source from github and use jeweler to install locally (requires jeweler):
$ git clone git://github.com/quirkey/jim.git
$ cd jim
$ rake install
From anywhere, install a project:
// From a URL
$ jim install http://code.jquery.com/jquery-1.4.2.js
// From a zip (with name and version)
$ jim install http://github.com/jquery/jquery-metadata/zipball/master jquery-metadata 2.0
In your project run:
$ jim init
Which creates an empty Jimfile
. Open it up and add your requirements:
{
"bundle_dir": "public/javascripts/",
"vendor_dir": "public/javascripts/vendor",
"bundles": {
"default": [
["jquery", "1.4.1"],
"sammy",
"app"
],
"mobile": [
"jquery",
"mobile"
]
}
}
As of v0.3 you can specified multiple named bundles. Each requirement is
specified in order of inclusion and can be either simply the name of the
library ("jquery"
) or an array of name and version (["jquery", "1.4.2"]
).
If its a rack-based project, mount the Jim::Rack middleware. It gives you live updates of your bundled and compressed js files:
use Jim::Rack, :bundle_uri => '/js/'
# GET /js/default.js # get by bundle name
# GET /js/mobile.js
# GET /js/mobile.min.js # compressed
Otherwise and also before deploys, etc, use the command line tool from your project's dir:
# Bundle into your bundle_dir
$ jim bundle
# Compress into your bundle dir
$ jim compress
# Copy all the requirements from your JIMHOME into vendor dir
# (before you commit)
$ jim vendor
# What you run before deploys. Runs vendor -> bundle -> compress.
$ jim pack
In order for compress
to work, you need either the yui-compressor gem or the
closure-compiler gem. Closure is the default.
Run jim help
for a full list of commands and jim help [COMMAND]
for help
with a specific command.
CommonJS has certainly come a long way in a year, but in general the file system support and variety of libraries just isn't completely there yet for this type of project (IMHO). Also, I love Ruby and writing this was actually fun and pretty fast.
With that said, I would gladly welcome anyone cloning the API in CommonJS (I'm just being lazy about it)
Probably?? Its all very new at this point so please test it out and let me know.
Jim is mostly written by Aaron Quint, but not without the help of these fine individuals.
Also, Thanks to Yehuda Katz for talking through some of the original ideas.
Copyright (c) 2010 Aaron Quint. See LICENSE for details.
FAQs
Unknown package
We found that jim demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.
Research
Security News
The Socket Research Team investigates a malicious Python typosquat of a popular password library that forces Windows shutdowns when input is incorrect.