Upgrade to Pro — share decks privately, control downloads, hide ads and more …

NPX-shell-hacking

 NPX-shell-hacking

WordCamp Ogijima 2018 の打ち上げの時に LT した npx コマンドの話

KamataRyo

August 25, 2018
Tweet

More Decks by KamataRyo

Other Decks in Technology

Transcript

  1. NPX γΣϧܳ
    ศརʂ

    View full-size slide

  2. γΣϧܳ
    • ίϚϯυ1ͭͰͳΜͰ΋͢Δతͳ
    @mattn_jp ͞Μͷ vim-script ͰγΣϧܳ

    https://qiita.com/mattn/items/d09c5018bdfe0b170b9a

    View full-size slide

  3. /PEFKTΛΞοϓσʔτ͠·͔ͨ͠ʁ
    /PEFKTͷϦϦʔεεέδϡʔϧ

    IUUQTHJUIVCDPNOPEFKT3FMFBTFSFMFBTFTDIFEVMF

    View full-size slide

  4. ΢Σϒ੍࡞ʹ΄΅ඞਢʹͳͬͨ

    ύοέʔδϚωʔδϟʔ
    $ npm
    • Gulp Ͱ Slime ΍ SASS Λ
    ίϯύΠϧͨ͠Γ..

    • WordPress ςʔϚͷ։ൃ؀
    ڥΛηοτΞοϓͨ͠Γ..

    • Gutenberg΋ npm Λར༻͠
    ͯ։ൃ͞Ε͍ͯΔΈ͍ͨ

    View full-size slide

  5. OQNW /PEFKTWҎ߱
    ʹಉࠝ͞ΕΔ

    ศརίϚϯυ
    $ npx
    • npm ͱͯ͠഑෍͞Ε͍ͯΔCLIίϚϯυΛμ΢ϯϩʔυ࣮ͯ͠ߦʂ

    View full-size slide

  6. OQYίϚϯυͷ࢖͍Ͳ͜Ζ
    w ͪΐͬͱͨ͠࡞ۀΛ͢Δ࣌ɻಛఆͷίϚϯυ͕ඞཁ͚ͩ
    ͲɺΠϯετʔϧ͢Δ·Ͱ΋ͳ͍ͳʙͱ͍͏࣌

    View full-size slide

  7. σϝϦοτ
    https://www.reddit.com/r/ProgrammerHumor/comments/6s0wov/
    heaviest_objects_in_the_universe/

    View full-size slide

  8. DPXTBZίϚϯυΛ૸ΒͤͯΈΔ
    ύοέʔδ໊ ίϚϯυҾ਺ʢࠓճ͸೚ҙͷจࣈྻʣ
    $ npx cowsay Moo!

    View full-size slide

  9. &+4ςϯϓϨʔτͷγϯλοΫεΤϥʔΛ

    ૉૣ͘ൃݟ͢Δ
    ύοέʔδ໊ ίϚϯυҾ਺ʢࠓճ͸ϑΝΠϧ໊ʣ
    $ npx ejs-lint example.com.conf.els

    View full-size slide

  10. +BWB֨ݴ"1*Ͱ༡Ϳ
    $ curl -s https://arigato-java.download/kakugen.json | jq -r '.
    [] | .t' | head -`expr $RANDOM % $(curl -s https://arigato-
    java.download/kakugen.json | jq '. | length')` | tail -1 | npx
    -q cowsay

    View full-size slide

  11. w γΣϧܳͷੈքͱOQNͷੈք͕ɺ

    OQYίϚϯυͰγʔϜϨεʹܨ͕ͬͨʂ
    w OQNͷϥΠϒϥϦ਺͸๲େʢݱࡏ ʣɻ

    ѱຐతͳγΣϧܳ͸ۤखͰ΋ɺϥΠϒϥϦʹਫ਼௨͍ͯ͠Ε͹
    Կ͔৽͍͜͠ͱ͕؆୯ʹͰ͖Δ͔΋
    w ໘ന͍࢖͍ํΛݟ͚ͭͨΒڭ͍͑ͯͩ͘͞ʂ

    View full-size slide