New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-jsdoced

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-jsdoced

It implements jsdoced javascript as a babel plugin

  • 1.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

babel-plugin-jsdoced

a babel plugin which use jsdoc to implement strong typing in javascript It implements the principle of jsdoced javascript as a babel plugin. It implements strong typing for functions in javascript. The type of the function arguments and of the return value are checked according to your jsdoc. It is working in browser and node.js. it has source maps.

On top of it it supports es6 arrow functions too! If you use react, don't worry it works with jsx without trouble.

Check it out! How to install it

What is JSDoced Javascript ?

Here is a Youtube video "JSDoced JS in 1min", it worth the whole minute :)

or in a single image

jsdoced javascript in a single image

Features

  • no dependancies
  • works in node.js and browser
  • support source maps
  • works with es2015 and react/jsx
  • even works with new es6 arrow function
  • easily integrable in modern js tools. browserify/webpack/gulp you name it

Use cases

  • Improve your tests
    • jsdoced javascript will detect a new kind of errors.
    • So this is an additional level of testing
    • better detect those bugs before your users see them :)
  • Debug build for library
    • any library provide a minified version and a normal version
    • You can provide a jsdoced version
    • this debug version contains additional code to help debug.
    • thus people can use this one when developping or testing their own project
    • and hopefully detect errors earlier.
    • Specially interesting when you are learning a library. because you are more likely to do mistakes. better for your users :)
    • see /examples/gulpfile for a example on how to that with gulp

Installation

$ npm install babel-plugin-jsdoced

Usage

.babelrc

{
  "plugins": ["jsdoced"]
}

With es6

{
  "presets": ["es2015"],
  "plugins": ["jsdoced"]
}

Via CLI

$ babel --plugins jsdoced script.js

With es6

$ babel --presets=es2015 --plugins jsdoced ./sample-es6.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["jsdoced"]
});

Keywords

FAQs

Package last updated on 29 Apr 2016

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc