What is the difference between `main` and `module` vs `exports` in package.json?

Generally speaking, the “exports” field superseded the “module” field. “module” itself has never been an official standard but it became so widespread that at some point it was a de facto standard. Note that the “module” field is still being used by TypeScript if tsconfig’s moduleResolution is set to node; see microsoft/TypeScript#50794 for more info. … Read more

how to require active record working outside of rails

Here’s how I’m using ActiveRecord outside of Rails: #!/usr/bin/ruby require ‘active_record’ require ‘mysql2’ # or ‘pg’ or ‘sqlite3’ ActiveRecord::Base.establish_connection( adapter: ‘mysql2’, # or ‘postgresql’ or ‘sqlite3’ database: ‘DB_NAME’, username: ‘DB_USER’, password: ‘DB_PASS’, host: ‘localhost’ ) # Note that the corresponding table is ‘orders’ class Order < ActiveRecord::Base end Order.all.each do |o| puts “o: #{o.inspect}” end

How to create include files in Lua language?

require “header” See the require entry in the Lua Reference manual. The file “header.lua” must be somewhere in Lua’s search path. You can see (and modify) the path at package.path See the package.path entry in the the Lua Reference Manual This wiki page describes ways of creating modules to load with require.

All caps constants in JavaScript. And requireds. And imports

Generally speaking it is common practice to capitalize your constants. This is a convention which tells other programmers that the value is fixed. The javascript keyword const, though confusing is not a constant in that sense. I think that is where you got confused. A constant is a concept/construct. Not a primitive type within the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)