GithubHelp home page GithubHelp logo

Comments (15)

hemanth avatar hemanth commented on July 17, 2024

No it's not a bug, look at index.js#L45

from generator-node.

stevemao avatar stevemao commented on July 17, 2024

So this is not using camelCase on purpose? Sorry I don't really understand this.

from generator-node.

hemanth avatar hemanth commented on July 17, 2024

@stevemao Are you facing any issue? That's just a naming convention.

from generator-node.

stevemao avatar stevemao commented on July 17, 2024

Not really, just think variable names should be camelCase. The ones in the code are camelCased but not in README.md. I have to manually change it every time.

from generator-node.

stevemao avatar stevemao commented on July 17, 2024

https://github.com/yeoman/generator-node/blob/master/app/templates/cli.js#L4

This is using safeSlugname

But in README.md it's

var <%= slugname %> = require('<%= slugname %>');

from generator-node.

stevemao avatar stevemao commented on July 17, 2024

I knew there was a problem 😸

from generator-node.

hemanth avatar hemanth commented on July 17, 2024

heh heh, we must use _.slugify rather than manually slugifying it.

from generator-node.

hemanth avatar hemanth commented on July 17, 2024

Ha, we are L46

from generator-node.

stevemao avatar stevemao commented on July 17, 2024

Looks like safeSlugname is camelCased name.

from generator-node.

hemanth avatar hemanth commented on July 17, 2024

Yes, that was done here as a fix, but I still feel that the readme must be slugname not safe slug.

from generator-node.

stevemao avatar stevemao commented on July 17, 2024

Any reason for this?

from generator-node.

hemanth avatar hemanth commented on July 17, 2024

Readme must not be safe, but rather must be plain slug.

Say if your module is named as is-mp3 doing a var is-mp3 is not a vaild literal, so we had to use safe names, that would result in isMp3 hence we could do var isMp3 = require('is-mp3')

from generator-node.

stevemao avatar stevemao commented on July 17, 2024

Isn't the part in readme sample code?

from generator-node.

hemanth avatar hemanth commented on July 17, 2024

@stevemao Sorry for the ping-pong the readme template must be:

var <%= safeSlugname %> = require('<%= slugname %>');

Feel free to send a PR.

from generator-node.

stevemao avatar stevemao commented on July 17, 2024

Sure 😃

from generator-node.

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.