Comments (3)
Thanks for the reply! In fact npm config
works fine for some parameters (e.g. version and license), but I am interested in also defining some other initial configuration in the generated package.json
, such as default start
and test
scripts.
I was under the impression that through init-package-json
's init
function I would be able to make such customisations. Maybe I misunderstood the purpose of the module?
from init-package-json.
What do you want to put in your package file that cannot be set with npm config
? Sorry for not being of any help.
from init-package-json.
.npm-init.js
is not living up to what I thought it was supposed to be. (and npm referring us here isn't too helpful as the API doesn't seem to match the format expected by .npm-init.js
.
A few problems so far:
use strict
caused a crash- I did discover from the README that
basename
,filename
, anddirname
(as well asprompt
) were predefined, but didn't end up needingrequire('path').basename
, so not too big of an issue for me, and one can rename. - I wanted to preconfigure a choice of
type
,scripts
,devDependencies
, etc. based on whether the user were using modules or not, yet I can't get this prompt to work:const modules = prompt('Module? (leave blank to be CommonJS)', 'y');
It seems prompt only works if being assigned to a variable likedescription
or one of the recognized export names, but I figured, I should be able to name variables as I wished within the file until setting onexports
.
from init-package-json.
Related Issues (20)
- Considering to init ESM default package.json? HOT 1
- package.json
- .github/PULL_REQUEST_TEMPLATE.md
- package.json
- Thanks for downloading Django. To install it, make sure you have Python 3.8 or greater installed. Then run this command from the command prompt: python -m pip install . For more detailed instructions, see docs/intro/install.txt.
- const globalThreshold = 50; // Global code coverage threshold (as a percentage)
- Screenshot 2022-02-17 at 15.58.10
- 18ffa74a4ca5896ef3218a4e2d6999720149e840
- "type": "object",
- N
- Money Pit
- Reporting a vulnerability HOT 1
- netbox/templates/extras/customfield.html
- 8b919b74149af92f4cad76c96080a254a72b7018
- * @npm/cli-team
- LICENSE
- LICENSE
- [BUG] <title>
- [BUG] <title> HOT 1
- [BUG] npm init not working - throws error HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from init-package-json.