req.params
/airtable/:record_id
and Dani caught up:
package.json
document that specifies an executable script's path (./cli.js
) and pairs it with an arbitrary word of our choosing that we'll use to launch the script:"bin": {
"my-launch-word": "./cli.js"
},
npm link
to install your package globally while in development, making my-launch-word
work from anywhere you happen to be in Terminal. Ultimately, when you publish your package to npmjs.com, other people (including future you) will run npm i -g [your_package]
to get the same effect.syntax for loops in js:
for (var i = 0; i < array.length; i++) {
console.log(array[i])
}
syntax for loops in ejs:
<ol>
<% for (i = 0; i < links.length; i++) { %>
<li>
<a href="<%- links[i].url %>" ><%- links[i].linkTitle %></a>.<% if (links[i].externalUrl) { %>
(direct link <a href= <%- links[i].externalUrl %> >here</a>).
<% } %>
<% if (links[i].text) { %>
<span class="light-gray">
<%- links[i].text %>
</span>
<% } %>
</li>
<% } %>
</ol>