midrissi / func-loc Goto Github PK
View Code? Open in Web Editor NEWA simple tool that helps you to retrieve the function location from its reference.
License: MIT License
A simple tool that helps you to retrieve the function location from its reference.
License: MIT License
Node.js 12.21.0
func-loc 0.1.16
Running on: Windows 10 CMD
Files:
├── modules
│ └── xx.js
── test.js
xx.js:
exports.XX = class XX {}
test.js:
const XX = require('./modules/xx').XX;
const locate = require('func-loc').locate;
console.log(locate(func));
The actual result is:
{
column: 14,
line: 1,
path: '/C:/Users/my/code/test/modules/xx.js',
source: 'file:///C:/Users/my/code/test/modules/xx.js'
}
the path and source is not Windows path. The excepted path is:
C:\Users\my\code\test\modules\xx.js
ESLint report CRLF end of line as errors.
In Windows, if git option core.autocrlf is set to true, all files will have CRLF eol after clone.
To fix this, you can clone with this command line:
git clone -c core.autocrlf=false https://github.com/midrissi/func-loc.git
This lib is amazing, I love it. Thank you for writing it up! How can I achieve the same in the browser?
Hi,
Can you please set the guidelines for repository contributors ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.