Skip to content

import syntax not working #38

@penguinsAreFunny

Description

@penguinsAreFunny

Hello,

I am not sure if I am mistaken, but I have no import-syntax working for properties-reader (using TypeScript).
Documentation:
const propertiesReader = require("properties-reader"); // works fine
const properties = propertiesReader("path");

Trying to use modern import-syntax does not work for me.
import * as propertiesReader from "properties-reader"); // does not work
import {PropertiesReader} from "properties-reader"; // does not work
import {propertiesReader} from "properties-reader"; // does not work
import {PropertiesReader} from "properties-reader/src/properties-reader"; // does not work
[...]

This might not be an issue but just me not understanding why this is not working. I have looked up require to import converters, which would convert the require-statement into one of the import statements above.
I think it is not working because of the unusual directory-structure of npm-properties-reader. Usually an npm module has an index.js file directly in the directory folder exporting all other visible modules.

I think it would be great if properties-reader import-syntax would be fair to conventions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions