Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

docrope

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

docrope - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

16

index.js

@@ -1,20 +0,4 @@

var transformCode = require('./src/transform');
/**
* Create metalsmith plugin function.
*
* @return {Function} metalsmith plugin
*/
module.exports = function() {
return function(files, metalsmith, done) {
for (var path in files) {
files[path].docrope = transformCode(files[path].contents.toString('utf8'));
}
done();
}
};
/**
* Parse JavaScript code and return doc comments data.

@@ -21,0 +5,0 @@ *

2

package.json
{
"name": "docrope",
"version": "0.0.0",
"version": "0.0.1",
"description": "Extremely simple JavaScript document generator.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,4 +13,5 @@ Docrope

var docrope = require('docrope');
var fs = require('fs');
console.log(docrope('./hoge.js'));
console.log(docrope.parse(fs.readFileSync('./hoge.js')));
```

@@ -17,0 +18,0 @@

@@ -41,3 +41,3 @@ var esprima = require('esprima');

var comments = result.comments
var comments = (result.comments || [])
.filter(function(comment) {

@@ -44,0 +44,0 @@ return comment.value.substr(0, 1) === '*';

@@ -7,6 +7,2 @@ var expect = require('chai').expect;

describe('docrope', function() {
it('should provide parse function and metalsmith plugin', function() {
expect(docrope()).is.a('function');
expect(docrope.parse).is.a('function');
});

@@ -18,2 +14,7 @@ describe('docrope()', function() {

describe('parse()', function() {
it('should parse empty string', function() {
var result = parse('');
expect(!!result.docComments).is.equal(true);
});
it('should parse testcase-01.js', function() {

@@ -20,0 +21,0 @@ var code = fs.readFileSync(__dirname + '/fixture/testcase-01.js');

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