to-source-code
Advanced tools
Comparing version 0.0.0 to 1.0.0
{ | ||
"name": "to-source-code", | ||
"version": "0.0.0", | ||
"version": "1.0.0", | ||
"description": "Converts function to its source code.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"lint": "jshint index.js", | ||
"pretest": "npm run lint", | ||
"test": "mocha -R spec", | ||
"test:cov": "rm -rf ./test/coverage && istanbul cover _mocha --dir ./test/coverage -- -R spec", | ||
"test:rpt": "npm run test:cov && coveralls < ./test/coverage/lcov.info", | ||
"prepublish": "npm test" | ||
}, | ||
"keywords": [ | ||
"to", | ||
"parse", | ||
"convert", | ||
"converter", | ||
"parser", | ||
"source", | ||
"function", | ||
"func", | ||
"fn", | ||
"code" | ||
], | ||
"author": { | ||
"name": "bubkoo", | ||
"email": "bubkoo.wy@gmail.com" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
@@ -13,8 +35,16 @@ "type": "git", | ||
}, | ||
"author": "bubkoo <bubkoo.wy@gmail.com> (https://github.com/bubkoo)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/bubkoo/to-source-code/issues" | ||
}, | ||
"homepage": "https://github.com/bubkoo/to-source-code#readme" | ||
"homepage": "https://github.com/bubkoo/to-source-code#readme", | ||
"devDependencies": { | ||
"jshint": "^2.9.1", | ||
"chai": "^3.5.0", | ||
"coveralls": "^2.11.9", | ||
"istanbul": "^0.4.2", | ||
"mocha": "^2.4.5" | ||
}, | ||
"dependencies": { | ||
"is-nil": "^1.0.0" | ||
} | ||
} |
# to-source-code | ||
Converts function to its source code. | ||
> Converts function to its source code. | ||
[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/bubkoo/to-source-code/blob/master/LICENSE) | ||
[![build:?](https://img.shields.io/travis/bubkoo/to-source-code/master.svg?style=flat-square)](https://travis-ci.org/bubkoo/to-source-code) | ||
[![coverage:?](https://img.shields.io/coveralls/bubkoo/to-source-code/master.svg?style=flat-square)](https://coveralls.io/github/bubkoo/to-source-code) | ||
## Install | ||
``` | ||
$ npm install --save to-source-code | ||
``` | ||
## Usage | ||
```js | ||
var toSourceCode = require('to-source-code'); | ||
toSourceCode(Math.min); | ||
// => 'function min() { [native code] }' | ||
toSourceCode(function () { console.log(123); }); | ||
// => 'function () { console.log(123); }' | ||
toSourceCode(); // => '' | ||
toSourceCode(null); // => '' | ||
toSourceCode(1); // => '1' | ||
toSourceCode('1'); // => '1' | ||
toSourceCode(true); // => 'true' | ||
toSourceCode({}); // => '[object Object]' | ||
``` | ||
## Related | ||
- [is-native](https://github.com/bubkoo/is-native) - Checks if the given value is a native function. | ||
- [to-num](https://github.com/bubkoo/to-num) - Converts the given value to a number. | ||
- [to-integer](https://github.com/bubkoo/to-integer) - Converts the given value to an integer. | ||
- [to-length](https://github.com/bubkoo/to-length) - Converts value to an integer suitable for use as the length of an array-like object. | ||
- [to-lower](https://github.com/bubkoo/to-lower) - Converts string, as a whole, to lower case. | ||
- [to-upper](https://github.com/bubkoo/to-upper) - Converts string, as a whole, to upper case. | ||
- [to-path](https://github.com/bubkoo/to-path) - Converts value to a property path array. | ||
## Contributing | ||
Pull requests and stars are highly welcome. | ||
For bugs and feature requests, please [create an issue](https://github.com/bubkoo/to-source-code/issues/new). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4391
4
13
0
52
0
1
5
+ Addedis-nil@^1.0.0
+ Addedis-nil@1.0.1(transitive)