Directory references in Node?

・1 min read

I recently purchased a React Native template and looking through the code, I saw something curious.
In their screens folder, they have a package.json file with this content:

    {
        "name": "@screens"
    }

and that was being used to import the screens, like:

    import SomeScreen from '@screens/some'

And that's awesome! I didn't know I could do that. I tested it and it worked perfectly. Now I'm trying to find that feature on the internet but I can't find anything about it, the only possible name I can think of for this is "Directory reference" and I got no results.

Did you know about this? How can I look for it?

Thanks in advance!

DISCUSSION
Classic DEV Post from Sep 17 '18

Learning and Mastering Vue.js

tips for learning and learning resources for vue.js

Full-Stack developer. Been doing React Native for a while but now I'm moving to Swift.
Join dev.to

Be a better developer. Free forever.