Socket
Socket
Sign inDemoInstall

ccjs

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ccjs

client side common js


Version published
Weekly downloads
114
increased by0.88%
Maintainers
1
Weekly downloads
 
Created
Source

ccjs

client-side common js

how does it work

  • you need to bring up an ccjs server or use the middlare(described below) inside your connect based application(e.g. express)
  • the browser make a request to the server asking for a js file
  • the original js file will be read from disk
  • all dependencies of that file get bundled and send to browser

limitations

  • only works with packages that has little to do with node, like jquery and lodash
  • require takes place on the server side, so dynamic require won't work

usage

using the middleware

see tests/server.js

var path = require('path');
var ccjs = require('ccjs').middleware;

app.use(ccjs({root:path.join(__dirname, '/public/js')}));
<script src="main.js?commonjs=1"></script>

coffeescript

npm install --save coffee-script
app.use ccjs
	root: path.join __dirname, '/public/js'
	coffee: on

grunt/gulp plugin

TBD

Keywords

FAQs

Package last updated on 30 Apr 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc