Directory references in Node?

github logo ・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!

twitter logo DISCUSS
Classic DEV Post from Sep 27 '18

Who is hiring? (As of September 2018)

Members of the community sharing open job opportunities at their companies.

Emmanuel Villalobos profile image
Full-Stack developer. Been doing React Native for a while but now I'm moving to Swift.

Top devs blog here. Free forever.