Socket
Socket
Sign inDemoInstall

to-source-code

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

to-source-code - npm Package Compare versions

Comparing version 0.0.0 to 1.0.0

index.js

40

package.json
{
"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).
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