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

espower-source

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

espower-source - npm Package Compare versions

Comparing version 0.7.3 to 0.8.0

CHANGELOG.md

4

index.js

@@ -13,3 +13,3 @@ /**

escodegen = require('escodegen'),
merge = require('lodash.merge'),
extend = require('xtend'),
convert = require('convert-source-map');

@@ -23,3 +23,3 @@

jsAst = esprima.parse(jsCode, {tolerant: true, loc: true, tokens: true, raw: true, source: filepath});
espowerOptions = merge(merge(espower.defaultOptions(), options), {
espowerOptions = extend(espower.defaultOptions(), options, {
destructive: true,

@@ -26,0 +26,0 @@ path: filepath

{
"name": "espower-source",
"version": "0.7.3",
"version": "0.8.0",
"description": "Power Assert instrumentor from source to source, with source-map",

@@ -26,2 +26,11 @@ "keywords": [

"main": "./index.js",
"files": [
"CHANGELOG.md",
"MIT-LICENSE.txt",
"README.md",
"gulpfile.js",
"index.js",
"package.json",
"test"
],
"repository": {

@@ -32,19 +41,30 @@ "type": "git",

"scripts": {
"bundle": "./node_modules/.bin/browserify index.js --standalone espowerSource > ./build/espower-source.js",
"jshint": "./node_modules/.bin/jshint index.js",
"test": "./node_modules/.bin/mocha"
"bower": "bower install --config.interactive=false",
"build": "gulp bundle",
"lint": "gulp lint",
"test": "gulp test"
},
"dependencies": {
"espower": "~0.7.0",
"esprima": "~1.2.1",
"escodegen": "~1.3.2",
"convert-source-map": "~0.3.3",
"lodash.merge": "~2.4.1"
"convert-source-map": "~0.4.0",
"escodegen": "~1.3.3",
"espower": "~0.8.0",
"esprima": "~1.2.2",
"xtend": "~4.0.0"
},
"devDependencies": {
"browserify": "~4.1.6",
"jshint": "~2.5.1",
"mocha": "~1.20.0",
"semver": "~2.3.0",
"source-map": "~0.1.33"
"brfs": "~1.2.0",
"browserify": "~5.9.1",
"del": "~0.1.1",
"glob": "~4.0.5",
"gulp": "~3.8.7",
"gulp-derequire": "~0.3.1",
"gulp-jshint": "~1.8.4",
"gulp-mocha": "~0.5.2",
"gulp-mocha-phantomjs": "~0.3.0",
"gulp-util": "~3.0.0",
"gulp-webserver": "~0.6.0",
"jshint-stylish": "~0.4.0",
"mocha": "~1.21.3",
"source-map": "~0.1.38",
"vinyl-source-stream": "~0.1.1"
},

@@ -51,0 +71,0 @@ "engines": {

@@ -8,3 +8,3 @@ espower-source

Power Assert instrumentor from source to source, with source-map.
Power Assert instrumentor from code to code, with SourceMap.

@@ -14,5 +14,5 @@

---------------------------------------
`espower-source` is a source code transformer that applies [espower](http://github.com/twada/espower) to target source.
`espower-source` is a source code transformer that applies [espower](http://github.com/twada/espower) to target code.
`espower` manipulates assertion expression (JavaScript Code) represented as [Mozilla JavaScript AST](https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API), to instrument power-assert feature into the code.
`espower` manipulates assertion expression (JavaScript Code) represented as [Mozilla JavaScript AST](https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API), to instrument power-assert feature into the code. SourceMap information is appended in SourceMap Comment syntax at the end of returned code.

@@ -24,2 +24,43 @@ Please note that `espower-source` is a beta version product. Pull-requests, issue reports and patches are always welcomed.

CHANGELOG
---------------------------------------
See [CHANGELOG](https://github.com/twada/espower-source/blob/master/CHANGELOG.md)
API
---------------------------------------
### var modifiedCode = espowerSource(originalCode, filepath, [options])
| return type |
|:------------|
| `string` |
`espowerSource` function manipulates `originalCode` then returns (transformed) JavaScript code as string. SourceMap information is appended in SourceMap Comment syntax at the end of returned code.
#### originalCode
| type | default value |
|:---------|:--------------|
| `string` | N/A |
Original JavaScript source code that is a source of code transformation.
#### filepath
| type | default value |
|:---------|:--------------|
| `string` | N/A |
Filepath of `originalCode`. If passed, espowerSource stores filepath information for later reporting.
#### options
| type | default value |
|:---------|:--------------|
| `object` | (return value of `espower.defaultOptions()` but with `destructive` option is `true`) |
Configuration options for `espower` module. If not passed, default options (Same as [espower.defaultOptions()](https://github.com/twada/espower#var-options--espowerdefaultoptions)) will be used, but `destructive` option is set to `true` by espower-source module.
AUTHOR

@@ -26,0 +67,0 @@ ---------------------------------------

@@ -1,6 +0,6 @@

var espowerSource = require('..'),
sourceMap = require('source-map'),
convert = require('convert-source-map'),
fs = require('fs'),
assert = require('assert');
var espowerSource = require('..');
var sourceMap = require('source-map');
var convert = require('convert-source-map');
var fs = require('fs');
var assert = require('assert');

@@ -10,3 +10,3 @@ describe('with default options', function() {

this.path = 'test/fixtures/example.js';
this.input = fs.readFileSync(this.path, 'utf8'),
this.input = fs.readFileSync('test/fixtures/example.js', 'utf8'),
this.output = espowerSource(this.input, this.path);

@@ -68,13 +68,9 @@ this.map = convert.fromSource(this.output).toObject();

this.path = 'test/fixtures/customized.js';
this.input = fs.readFileSync(this.path, 'utf8'),
this.input = fs.readFileSync('test/fixtures/customized.js', 'utf8'),
this.output = espowerSource(this.input, this.path, {
powerAssertVariableName: 'refute',
targetMethods: {
oneArg: [
'isNull'
],
twoArgs: [
'same'
]
}
patterns: [
'refute(actual, [message])',
'refute.same(actual, expected, [message])',
'refute.isNull(object, [message])'
]
});

@@ -81,0 +77,0 @@ this.map = convert.fromSource(this.output).toObject();

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