Giter VIP home page Giter VIP logo

Comments (3)

htaunay avatar htaunay commented on August 14, 2024 1

Thanks for the reply! In fact npm configworks 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 startand 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.

michaelnisi avatar michaelnisi commented on August 14, 2024

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.

brettz9 avatar brettz9 commented on August 14, 2024

.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:

  1. use strict caused a crash
  2. I did discover from the README that basename, filename, and dirname (as well as prompt) were predefined, but didn't end up needing require('path').basename, so not too big of an issue for me, and one can rename.
  3. 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 like description 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 on exports.

from init-package-json.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.