Socket
Book a DemoInstallSign in
Socket

jsdev

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdev

JSDev is a filter that activates selected comments, making them executable. This is a wrapper for use JSDev in your node project. It will change hte require function behavior. Check the project homepage on github to learn more. If you just want to use JSDev, check the `JSDev` module(it's another module since npm registry is case-sensitive).

0.1.3
latest
Source
npmnpm
Version published
Weekly downloads
3
200%
Maintainers
1
Weekly downloads
 
Created
Source

#JSDev wrapper for node

JSDev is a JavaScript Development Tool written by Doglas Crockford douglas@crockford.com:

JSDev is a filter that activates selected comments, making them executable.  This makes it possible to put development, performance, and testing scaffolding into a source file. The scaffolding is removed by minification, but is activated by JSDev.

You can refer to his original project repository to learn how to use it.

This module change the require() function behavior so that you could easily use JSDev in your node projects.

##Example a.js:

require('jsdev').modifyRequire()
require('./b')
/*log 'tag in script which require jsdev will not be opened'*/

b.js:

var util = require('util')
//jsdev(test) tag2 log:console.log
//jsdev(test,production) tag1
//jsdev tag1 log:util.log
/*tag1 console.log('tag1 opened')*/
/*tag2 console.log('tag2 opened')*/
/*log 'function tag'*/

default(development) environment:

$ node a.js
tag1 opened
10 Feb 13:23:53 - function tag

test environment:

$ NODE_ENV=test node a.js 
tag1 opened
tag2 opened
function tag

production environment:

$ NODE_ENV=production node a.js 
tag1 opened

##Usage

  • Add jsdev@>=0.0.1 into devDependencies in the package.json file of your project.
  • require('jsdev').
  • Any futher require()'d file will apply the rules specified in the file as a comment line start with //jsdev
  • Use //jsdev(test,production) tag1 to turn on tag3 in test and production environment. If you don't specify the environment, it will default to be development(//jsdev tag2 turn tag2 on in only the development environment).

FAQs

Package last updated on 04 Sep 2012

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.