3 ms·
You're not alone. Maybe it's lack of knowledge on my part... but too much around node / npm, still seems like copy/pasting random incontations into the command
by christoph 4y ago
You're not alone. Maybe it's lack of knowledge on my part... but too much around node / npm, still seems like copy/pasting random incontations into the command line to try and solve whatever problem I have at a specific time. There is lot's of good in there, but somethings just don't work how you think they will.
For instance, we've been building a totally static site recently in node/npm/js/posthtml and posthtml has a concept of "local variables". A project called posthtml-expressions in theory allows you to put "expressions" into "HTML" modules (if's, loops, etc.), but it only works with "globally" defined variables. i.e. you can't define a variable locally to a component, you need to define it "globally" in the project, which IMO defeats the whole purpose of the project. Nowhere is this easily explained or defined in their documentation. The first thing I want to do is define a property/attribute inline to a component, otherwise I end up with word soup of global variables - $page_1_title, $page_2_title, etc., rather than <component title="xxx">. Bizarre. No idea what the point is if I can't declare variables "locally" to said component? And this is the feeling I've got of lots of NPM packages - there is just no cohesion between things. I love the work people have done, it's literally saved me hundreds of man hours, but I've also spent untold hours wrestling with things that seem obvious to me, that should work, which frankly just don't work how I expect. Maybe it's me?